Skip to content

Commit

Permalink
PRINCE: O_WALKHERO, walkTo() update
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Jul 19, 2014
1 parent f66a285 commit 0415d35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions engines/prince/prince.cpp
Expand Up @@ -2009,8 +2009,8 @@ void PrinceEngine::walkTo() {
_mainHero->_destDirection = _mobList[_optionsMob]._examDirection;
} else {
Common::Point mousePos = _system->getEventManager()->getMousePos();
destX = mousePos.x;
destY = mousePos.y;
destX = mousePos.x + _picWindowX;
destY = mousePos.y + _picWindowY;
_mainHero->_destDirection = 0;
}
_mainHero->_coords = makePath(destX, destY);
Expand Down
14 changes: 12 additions & 2 deletions engines/prince/script.cpp
Expand Up @@ -956,9 +956,19 @@ void Interpreter::O_MOVEHERO() {

void Interpreter::O_WALKHERO() {
uint16 heroId = readScriptFlagValue();

Hero *hero = nullptr;
if (!heroId) {
hero = _vm->_mainHero;
} else if (heroId == 1) {
hero = _vm->_secondHero;
}
if (hero != nullptr) {
if (hero->_state != Hero::STAY) {
_currentInstruction -= 4;
_opcodeNF = 1;
}
}
debugInterpreter("O_WALKHERO %d", heroId);
_opcodeNF = 1;
}

void Interpreter::O_SETHERO() {
Expand Down

0 comments on commit 0415d35

Please sign in to comment.