Fix walk interval calculation

This commit is contained in:
Eduardo Bart 2012-07-30 11:03:58 -03:00
parent 59b6abfa09
commit 8e437e27c7
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -526,7 +526,7 @@ void Game::autoWalk(const std::vector<Otc::Direction>& 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)