Bad Boy JH
2010-10-12 21:24:54
as soon as I realised ground items was updated, i checked it out, however there is an error in this code. This will only get the items in the top right (I think - when values are greatest), because each loop it replaces the T_GIA.
function GetItemsNear(AreaFromMe: Integer): TGroundItemArray;
var
I, II: Integer;
MyPos: TPoint;
t_GIA: TGroundItemArray;
begin
If Not LoggedIn then
Exit;
MyPos := GetMyPos;
For I:=0 to AreaFromMe*2 do
For II:=0 to AreaFromMe*2 do
t_GIA := GetItemsAt(Tile(MyPos.X-AreaFromMe+II, MyPos.Y-AreaFromMe+I));
Result := t_GIA;
end;