From 8e437e27c714f7e4086641f181b9814ee12c0767 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 30 Jul 2012 11:03:58 -0300 Subject: [PATCH] Fix walk interval calculation --- src/otclient/creature.cpp | 6 +++--- src/otclient/game.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/otclient/creature.cpp b/src/otclient/creature.cpp index 2bc4b9be..0adaf8d8 100644 --- a/src/otclient/creature.cpp +++ b/src/otclient/creature.cpp @@ -266,9 +266,9 @@ void Creature::walk(const Position& oldPos, const Position& newPos) // calculates walk interval int groundSpeed = 0; - TilePtr oldTile = g_map.getTile(oldPos); - if(oldTile) - groundSpeed = oldTile->getGroundSpeed(); + TilePtr tile = g_map.getTile(newPos); + if(tile) + groundSpeed = tile->getGroundSpeed(); float interval = 1000; if(groundSpeed > 0 && m_speed > 0) diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index 1219dbaf..34949688 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -526,7 +526,7 @@ void Game::autoWalk(const std::vector& dirs) m_protocolGame->sendAutoWalk(dirs); - g_lua.callGlobalField("g_game", "onAutoWalk", direction); + g_lua.callGlobalField("g_game", "onAutoWalk", dirs); } void Game::forceWalk(Otc::Direction direction)