Results 1 to 3 of 3

Thread: Typo in function GetEquippedItemBounds

  1. #1
    Join Date
    Aug 2007
    Location
    Where do you live?
    Posts
    934
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Typo in function GetEquippedItemBounds

    Figured this out when WearingItem(10) didn't find my ring... then I realized 11 was for ring, but 11 caused error in this function because it didn't exist lol...
    Simba Code:
    {Gametab.simba - gametab 5 related functions}
    {*******************************************************************************
    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;
        10, 'boots' :  //10 is currently set to 'ring' which is wrong based off of EquipmentCoords
          I := 10;
        11, 'ring' : // also 11 was never entered lol...
          I := 11;  // even though the failsafes in the other functions are:
        else         // "if InRange(x, 1, 11)..."
        begin
          SRL_Warn('GetEquiptItemBounds', 'Invalid entry ('+string(Which)+')', Warn_AllVersions);
          Result := IntToBox(0, 0, 0, 0);
          Exit;
        end;
      end;
      P := EquipmentCoords(I);
      Result := IntToBox(P.x - 11, P.y - 11, P.x + 11, P.y + 11);
    end;
    All fixed for you
    And I'm pretty sure the rest of them are correct...

  2. #2
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

  3. #3
    Join Date
    Aug 2007
    Location
    Where do you live?
    Posts
    934
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hrmmmm... "12-09-2010" guess no one thinks that this is important...?

    Thanks KingKong, guess i shoulda searched first..

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
  •