From b9dfc7784cf319592d477b9dbac0d4cf8241f50c Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Thu, 2 Aug 2012 09:13:01 -0300 Subject: [PATCH] Fixed push of creatures in 9.6 --- src/otclient/game.cpp | 13 +++++++++++-- src/otclient/tile.cpp | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index 3de3df9c..08294382 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -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(); + id = Proto::Creature; + } + + m_protocolGame->sendMove(thing->getPosition(), id, thing->getStackpos(), toPos, count); } void Game::moveToParentContainer(const ThingPtr& thing, int count) diff --git a/src/otclient/tile.cpp b/src/otclient/tile.cpp index 556b9a8d..c7e4ecc7 100644 --- a/src/otclient/tile.cpp +++ b/src/otclient/tile.cpp @@ -373,6 +373,11 @@ ThingPtr Tile::getTopMoveThing() } } + for(const ThingPtr& thing : m_things) { + if(thing->isCreature()) + return thing; + } + return m_things[0]; }