aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/script.cpp
diff options
context:
space:
mode:
authorlukaslw2014-07-20 01:46:47 +0200
committerlukaslw2014-07-20 01:46:47 +0200
commit0415d35cdb4e10bf8ead959ed6920f1d2f3be26e (patch)
tree0069db917ec70339478aa29c5d00d689ae1f8e74 /engines/prince/script.cpp
parentf66a285551c2e91037b7e669facc3e2e6a5173bb (diff)
downloadscummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.tar.gz
scummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.tar.bz2
scummvm-rg350-0415d35cdb4e10bf8ead959ed6920f1d2f3be26e.zip
PRINCE: O_WALKHERO, walkTo() update
Diffstat (limited to 'engines/prince/script.cpp')
-rw-r--r--engines/prince/script.cpp14
1 files changed, 12 insertions, 2 deletions
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() {