Fixed push of creatures in 9.6
This commit is contained in:
parent
f103f3ee62
commit
b9dfc7784c
|
@ -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)
|
||||
|
|
|
@ -373,6 +373,11 @@ ThingPtr Tile::getTopMoveThing()
|
|||
}
|
||||
}
|
||||
|
||||
for(const ThingPtr& thing : m_things) {
|
||||
if(thing->isCreature())
|
||||
return thing;
|
||||
}
|
||||
|
||||
return m_things[0];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue