SRL Archive - Reflection Help

[Possible Bug] IsEquipedID


trojan

2011-05-11 17:33:39

After running my own program to see which items were equipped I got the following result…
Equipment = -1
Equipment = -1
Equipment = -1
Equipment = 1275
Equipment = -1
Equipment = -1
Equipment = -1
Equipment = -1
Equipment = -1
Equipment = 13562
Equipment = -1

Then I called IsEquippedID(13562) to find the result was false… I went into the equipment include and changed the function to…

function IsEquippedIDEx(IDs: TIntegerArray): boolean;
var
Equipment: TEquipmentSet;
i, ii: integer;
begin
Result := False;
Equipment := GetEquipment;
for i := High(IDs) downto 0 do
for ii := 10 downto 0 do
begin
Writeln(IntToStr(IDs[i]) + ' ' + intToStr(Equipment.Items[i].ID)); // This
if (IDs[i] = Equipment.Items[i].ID) then
begin
Result := True;
Exit;
end;
end;
end;

Strangely this was returning the following
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1
13562 -1

(the 13562 was what i sent..) any ideas anyone?

Kasi

2011-05-11 17:35:04

it returns -1 if no item is found i think i havent looked through the includes

trojan

2011-05-12 03:03:34

yeah thats what I'm saying… but I had 2 items equipped and the program I wrote to see what the ID's were of my equipment showed that I had 2 items

JuKKa

2011-05-12 03:56:38

Writeln(IntToStr(IDs) + ' ' + intToStr(Equipment.Items[ii].ID)); // This

i think

trojan

2011-05-13 17:03:15

Yeah, good point… but the function was still returning false though :?

Method

2011-05-13 19:06:34

if (IDs[i] = Equipment.Items[i].ID) then

should be

if (IDs[i] = Equipment.Items[ii].ID) then

trojan

2011-05-14 04:24:05

That works :) thanks, will this be updated for everyone?

pyroryan

2011-05-18 16:13:15

From: trojan
That works :) thanks, will this be updated for everyone?


Done. I think it was pushed a few days ago.