Results 1 to 10 of 10

Thread: Unkown Bug

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Unkown Bug

    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.

    SCAR Code:
    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)


    I := 1
    Step 1 completed
    Step 2 completed
    Step 3 completed
    I := 2
    Last edited by Drakan; 05-31-2010 at 12:39 AM.

  2. #2
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

    Formally known as Drags111.

  3. #3
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

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

  4. #4
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    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.
    Extinct.

    Formally known as Drags111.

  5. #5
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by drags111 View Post
    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:
    SCAR Code:
    SmartFreeObject(Inv);
    SmartFreeObject(Itm);
    SmartFreeObject(Name);
    SmartFreeObject(Acts);
    ???

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

  6. #6
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    That... Doesn't make sense o_o

    What's up with this:
    SCAR Code:
    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.
    Extinct.

    Formally known as Drags111.

  7. #7
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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 =]
    Extinct.

    Formally known as Drags111.

  8. #8
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sweet thanks

  9. #9
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    What was the bug? How did you fix it?

  10. #10
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just Confirming the fix DOES work.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •