SRL Archive - SRL Bugs

[Error] gametab.scar


KingKong

2010-12-09 04:32:56

File: \Simba\Includes\SRL\SRL\core\gametab.scar


{*******************************************************************************
function GetEquippedItemBounds(Which: String): TBox;
By: Nava2
Description: Returns TBox of eqquipped item in which.
*******************************************************************************}
function GetEquippedItemBounds(Which: Variant): TBox;
var
P : TPoint;
I : Byte;
begin
Which := LowerCase(Which);
case Which of
1, 'helm', 'helmet' :
I := 1;
2, 'cape' :
I := 2;
3, 'amulet', 'neck', 'necklace' :
I := 3;
4, 'arrows', 'bolts' :
I := 4;
5, 'right hand', 'weapon' :
I := 5;
6, 'plate', 'chest', 'platebody' :
I := 6;
7, 'left hand', 'sheild', 'shield' :
I := 7;
8, 'legs', 'platelegs', 'skirt', 'plateskirt' :
I := 8;
9, 'gloves', 'gauntlets' :
I := 9;


Here comes the error:
For number 10 it should say this:

10, 'boots' :
I := 10;

There should also be a option 11 like so:

11, 'ring' :
I := 11;

This might not be that significant, but maybe this could be modified in the future versions of srl?

KingKong

2011-07-05 06:28:56

Bump, this still hasn't been fixed! Grr!

Dgby714

2011-07-05 08:46:37

function GetEquippedItemBounds(Which: Variant): TBox;
var
P: TPoint;
I: Integer;
begin
Result := IntToBox(0, 0, 0, 0);
I := -1;

case VarType(Which) of
varInteger: if (InRange(Which, 1, 11)) then
I := Which;

varString: case Which of
'helm', 'helmet' :
I := 1;
'cape' :
I := 2;
'amulet', 'neck', 'necklace' :
I := 3;
'arrows', 'bolts' :
I := 4;
'right hand', 'weapon' :
I := 5;
'plate', 'chest', 'platebody' :
I := 6;
'left hand', 'sheild', 'shield' :
I := 7;
'legs', 'platelegs', 'skirt', 'plateskirt' :
I := 8;
'gloves', 'gauntlets' :
I := 9;
'boots':
I := 10;
'ring' :
I := 11;
end;
end;

if (I = -1) then
begin
SRL_Warn('GetEquiptItemBounds', 'Invalid entry (' + ToStr(Which) + ')', Warn_AllVersions);
Exit;
end;

P := EquipmentCoords(I);
Result := IntToBox(P.x - 11, P.y - 11, P.x + 11, P.y + 11);
end;

Coh3n

2011-08-02 11:48:11

Sorry I just saw this now. Committed; although it could probably be updated for the new slot (can't remember what it's called).

Nava2

2011-08-02 12:42:57

From: Coh3n
Sorry I just saw this now. Committed; although it could probably be updated for the new slot (can't remember what it's called).


Auras and Thanks dgby, I was just looking at that function, its far from Type safe haha. It is in yours though. :)