From c6c71a3426094538a60121006f3a83a72971687c Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Fri, 6 Jan 2012 14:16:47 -0200 Subject: [PATCH] fix object menu order --- src/otclient/core/tile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/otclient/core/tile.cpp b/src/otclient/core/tile.cpp index 93095dc7..aa9586e8 100644 --- a/src/otclient/core/tile.cpp +++ b/src/otclient/core/tile.cpp @@ -202,7 +202,7 @@ ThingPtr Tile::getTopLookThing() if(isEmpty()) return nullptr; - for(int i = m_things.size() - 1; i >= 0; --i) { + for(uint i = 0; i < m_things.size(); ++i) { ThingPtr thing = m_things[i]; if(!thing->ignoreLook() && (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop())) return thing; @@ -216,9 +216,9 @@ ThingPtr Tile::getTopUseThing() if(isEmpty()) return nullptr; - for(int i = m_things.size() - 1; i >= 0; --i) { + for(uint i = 0; i < m_things.size(); ++i) { ThingPtr thing = m_things[i]; - if(thing->isForceUse() || (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop())) + if(thing->isForceUse() || (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->asCreature())) return thing; } @@ -228,7 +228,7 @@ ThingPtr Tile::getTopUseThing() CreaturePtr Tile::getTopCreature() { CreaturePtr creature; - for(int i = m_things.size() - 1; i >= 0; --i) { + for(uint i = 0; i < m_things.size(); ++i) { ThingPtr thing = m_things[i]; if(thing->asLocalPlayer()) // return local player if there aint no other creature. creature = thing->asCreature();