fix some issues with stackpos

master
Eduardo Bart 12 years ago
parent 1013ae279b
commit a24fe38174

@ -157,11 +157,18 @@ ThingPtr Tile::addThing(const ThingPtr& thing, int stackPos)
}
if(stackPos < 0) {
// the items stackpos follows this order:
// 0 - ground
// 1 - ground borders
// 2 - bottom (walls)
// 3 - on top (doors)
// 4 - creatures, from top to bottom
// 5 - items, from top to bottom
stackPos = 0;
int priority = thing->getStackPriority();
for(stackPos = 0; stackPos < (int)m_things.size(); ++stackPos) {
int otherPriority = m_things[stackPos]->getStackPriority();
if(otherPriority > priority || (otherPriority == priority && otherPriority == 5))
if(otherPriority > priority)
break;
}
} else if(stackPos > (int)m_things.size())

@ -994,7 +994,7 @@ void ProtocolGame::setTileDescription(InputMessage& msg, Position position)
ThingPtr thing = internalGetThing(msg);
if(thing)
g_map.addThing(thing, position, 255);
g_map.addThing(thing, position, -1);
}
stackPos++;
}

Loading…
Cancel
Save