Debugged updating the position of the hero during walking.

I project the hero immediately to the end of each edge for the time being
though.

svn-id: r45722
This commit is contained in:
Robert Špalek 2009-11-07 11:45:13 +00:00
parent db58f6b998
commit 0b67aa406e
5 changed files with 77 additions and 61 deletions

View file

@ -664,8 +664,13 @@ void Script::stayOn(Common::Queue<int> &params) {
SightDirection dir = static_cast<SightDirection> (params.pop());
// Jumps into the given position regardless of the walking map.
Common::Point heroPos(_vm->_game->findNearestWalkable(x, y));
Common::Point mousePos(_vm->_mouse->getPosX(), _vm->_mouse->getPosY());
_vm->_game->stopWalking();
_vm->_game->positionHero(_vm->_game->findNearestWalkable(x, y), dir);
_vm->_game->setHeroPosition(heroPos);
_vm->_game->playHeroAnimation(WalkingState::animationForSightDirection(
dir, heroPos, mousePos, WalkingPath()));
}
void Script::walkOn(Common::Queue<int> &params) {