From 8cc880ba75eead0a20a08ee3dcab6bbfc062cf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Piwi=C5=84ski?= Date: Thu, 22 Oct 2020 21:02:25 +0200 Subject: [PATCH] [tile] fix getTopMultiUseThing() --- src/client/tile.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 2c3a3e739..2d74b1c43 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -444,32 +444,9 @@ ThingPtr Tile::getTopMoveThing() ThingPtr Tile::getTopMultiUseThing() { - if(isEmpty()) - return nullptr; - if(CreaturePtr topCreature = getTopCreature()) return topCreature; - - for(auto thing: m_things) { - if(thing->isForceUse()) - return thing; - } - - for(uint i = 0; i < m_things.size(); ++i) { - ThingPtr thing = m_things[i]; - if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()) { - if(i > 0 && thing->isSplash()) - return m_things[i-1]; - return thing; - } - } - - for(auto thing: m_things) { - if(!thing->isGround() && !thing->isOnTop()) - return thing; - } - - return m_things[0]; + return getTopUseThing(); } bool Tile::isWalkable(bool ignoreCreatures)