Fixed push of creatures in 9.6

This commit is contained in:
Eduardo Bart 2012-08-02 09:13:01 -03:00
parent f103f3ee62
commit b9dfc7784c
2 changed files with 16 additions and 2 deletions

View File

@ -624,12 +624,21 @@ void Game::look(const ThingPtr& thing)
void Game::move(const ThingPtr& thing, const Position& toPos, int count)
{
if(!canPerformGameAction() || !thing || thing->getPosition() == toPos || count <= 0)
if(count <= 0)
count = 1;
if(!canPerformGameAction() || !thing || thing->getPosition() == toPos)
return;
m_localPlayer->lockWalk();
m_protocolGame->sendMove(thing->getPosition(), thing->getId(), thing->getStackpos(), toPos, count);
uint id = thing->getId();
if(thing->isCreature()) {
CreaturePtr creature = thing->static_self_cast<Creature>();
id = Proto::Creature;
}
m_protocolGame->sendMove(thing->getPosition(), id, thing->getStackpos(), toPos, count);
}
void Game::moveToParentContainer(const ThingPtr& thing, int count)

View File

@ -373,6 +373,11 @@ ThingPtr Tile::getTopMoveThing()
}
}
for(const ThingPtr& thing : m_things) {
if(thing->isCreature())
return thing;
}
return m_things[0];
}