diff --git a/src/framework/luaengine/luaobject.h b/src/framework/luaengine/luaobject.h index e7722dad..dd694148 100644 --- a/src/framework/luaengine/luaobject.h +++ b/src/framework/luaengine/luaobject.h @@ -82,6 +82,8 @@ public: LuaObjectPtr asLuaObject() { return shared_from_this(); } + void operator=(const LuaObject& other) { } + private: int m_fieldsTableRef; int m_metatableRef; diff --git a/src/otclient/tile.cpp b/src/otclient/tile.cpp index b0ad32bc..7c58beff 100644 --- a/src/otclient/tile.cpp +++ b/src/otclient/tile.cpp @@ -171,9 +171,9 @@ ThingPtr Tile::addThing(const ThingPtr& thing, int stackPos) // 4 - creatures, from top to bottom // 5 - items, from top to bottom if(stackPos < 0) { - bool prepend = (stackPos == -2); stackPos = 0; int priority = thing->getStackPriority(); + bool prepend = (stackPos == -2 || priority <= 3); for(stackPos = 0; stackPos < (int)m_things.size(); ++stackPos) { int otherPriority = m_things[stackPos]->getStackPriority(); if(!g_game.getFeature(Otc::GameReverseCreatureStack)) { @@ -257,28 +257,12 @@ int Tile::getThingStackpos(const ThingPtr& thing) ThingPtr Tile:: getTopThing() { + if(isEmpty()) + return nullptr; for(const ThingPtr& thing : m_things) { if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->isCreature()) return thing; } - for(const ThingPtr& thing : m_things) { - if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()) - return thing; - } - for(const ThingPtr& thing : m_things) { - if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom()) - return thing; - } - for(const ThingPtr& thing : m_things) { - if(!thing->isGround() && !thing->isGroundBorder()) - return thing; - } - for(const ThingPtr& thing : m_things) { - if(!thing->isGround()) - return thing; - } - if(isEmpty()) - return nullptr; return m_things[m_things.size() - 1]; }