SRL Archive - SRL Bugs

Unkown Bug


Bad Boy JH

2010-05-30 08:47:04

Not sure where to post this, but the developement area seems the most logical place, (perhaps a bugs forum is needed (hopefully not))

When I tried Running R_ItemIDExists(Item, 1925)
(1925 is an empty bucket) but when it crashes, I have done a quick check to see when error occours….

I edited the function (added some Writeln and Waits) so I could see what happened before simba completly crashed.

function R_ItemIDExists(var Item: TInvItem; ID: Integer): boolean;
var
i: integer;
Temp: TInvItem;
begin
Result := true;
for i := 1 to 28 do
begin
Writeln('I := ' + IntToStr(I));
Temp := GetInvItemAt(i);
Writeln('Step 1 completed');
Wait(1500);
Item := Temp;
Writeln('Step 2 completed');
Wait(1500);
if(Temp.ID = ID)then
exit;
Writeln('Step 3 completed');
Wait(1500);
end;
Temp := NullInvItem;
Result := false;
end;

Which outputs (in debug)

[BANANA]
I := 1
Step 1 completed
Step 2 completed
Step 3 completed
I := 2[/BANANA]

Drakan

2010-05-30 08:53:07

Does it say anything when it crashes? Can I see the function you are using it in?

Gu3st...

2010-05-30 09:17:12

It's the "GetInvItemAt(i);" that makes it crash, so so the bug is probably in there

Drakan

2010-05-30 10:29:13

From: Zyt3x
It's the "GetInvItemAt(i);" that makes it crash, so so the bug is probably in there


I had this problem yesterday but it wasnt in that function. It was outside of it.

Gu3st...

2010-05-30 13:52:09

From: drags111
I had this problem yesterday but it wasnt in that function. It was outside of it.
That… Doesn't make sense o_o

What's up with this:
SmartFreeObject(Inv);
SmartFreeObject(Itm);
SmartFreeObject(Name);
SmartFreeObject(Acts);
???

Does "SmartGetFieldObject()" create an object when called?

Drakan

2010-05-30 16:45:48

From: Zyt3x
That… Doesn't make sense o_o

What's up with this:
SmartFreeObject(Inv);
SmartFreeObject(Itm);
SmartFreeObject(Name);
SmartFreeObject(Acts);
???

Does "SmartGetFieldObject()" create an object when called?


Its like FreeDTM. You have to call it or you get memory leaks.

Drakan

2010-05-30 20:38:25

I have fixed the bug, permanently, and fixed inventory.simba to be a lot more standard orientated, cleaner, and to prevent that bug from ever happening again. Solved =]

Bad Boy JH

2010-05-31 01:41:34

sweet thanks

Gu3st...

2010-05-31 05:36:07

What was the bug? How did you fix it?

Bad Boy JH

2010-05-31 07:46:03

Just Confirming the fix DOES work.