diff --git a/src/otclient/core/tile.cpp b/src/otclient/core/tile.cpp index 94bd6462..e26abb3e 100644 --- a/src/otclient/core/tile.cpp +++ b/src/otclient/core/tile.cpp @@ -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()) diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index 6d9aa782..995d4c03 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -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++; }