diff options
author | lukaslw | 2014-07-20 01:46:47 +0200 |
---|---|---|
committer | lukaslw | 2014-07-20 01:46:47 +0200 |
commit | 0415d35cdb4e10bf8ead959ed6920f1d2f3be26e (patch) | |
tree | 0069db917ec70339478aa29c5d00d689ae1f8e74 | |
parent | f66a285551c2e91037b7e669facc3e2e6a5173bb (diff) | |
download | scummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.tar.gz scummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.tar.bz2 scummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.zip |
PRINCE: O_WALKHERO, walkTo() update
-rw-r--r-- | engines/prince/prince.cpp | 4 | ||||
-rw-r--r-- | engines/prince/script.cpp | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index e08c2ebb1a..b44b136895 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -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); diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 3f76b91fb7..3ae974e4f7 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -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() { |