fix object menu order

This commit is contained in:
Henrique Santiago 2012-01-06 14:16:47 -02:00
parent 17c903d66c
commit c6c71a3426
1 changed files with 4 additions and 4 deletions

View File

@ -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();