aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorlukaslw2014-07-25 15:21:31 +0200
committerlukaslw2014-07-25 15:21:31 +0200
commit2a1b354a6df3b3d7322561b8d62f7c5626230838 (patch)
treec033cdabf147377af58128b78602d616bbafc264 /engines
parent98dafb866709273ffa984b6f709b94fbdab1e912 (diff)
downloadscummvm-rg350-2a1b354a6df3b3d7322561b8d62f7c5626230838.tar.gz
scummvm-rg350-2a1b354a6df3b3d7322561b8d62f7c5626230838.tar.bz2
scummvm-rg350-2a1b354a6df3b3d7322561b8d62f7c5626230838.zip
PRINCE: Hero bored timer - update
Diffstat (limited to 'engines')
-rw-r--r--engines/prince/hero.cpp24
-rw-r--r--engines/prince/prince.cpp2
-rw-r--r--engines/prince/script.cpp4
-rw-r--r--engines/prince/script.h1
4 files changed, 21 insertions, 10 deletions
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp
index 5edbed5df7..a0e7533c69 100644
--- a/engines/prince/hero.cpp
+++ b/engines/prince/hero.cpp
@@ -736,17 +736,21 @@ void Hero::showHero() {
}
if (_state == STAY) {
- if (!_vm->_optionsFlag && !_vm->_interpreter->getLastOPCode()) { // TODO - check OPCODE after right click
- _boredomTime++;
- if (_boredomTime == _maxBoredom) {
- _boreNum =_vm->_randomSource.getRandomNumber(1); // rand one of two 'bored' animation
- _phase = 0;
- _state = BORE;
- if (_lastDirection == kHeroDirUp) {
- _lastDirection = kHeroDirLeft;
- } else {
- _lastDirection = kHeroDirDown;
+ if (!_vm->_optionsFlag) {
+ if (!_vm->_interpreter->getLastOPCode() || !_vm->_interpreter->getFgOpcodePC()) {
+ _boredomTime++;
+ if (_boredomTime == _maxBoredom) {
+ _boreNum =_vm->_randomSource.getRandomNumber(1); // rand one of two 'bored' animation
+ _phase = 0;
+ _state = BORE;
+ if (_lastDirection == kHeroDirUp) {
+ _lastDirection = kHeroDirLeft;
+ } else {
+ _lastDirection = kHeroDirDown;
+ }
}
+ } else {
+ _boredomTime = 0;
}
} else {
_boredomTime = 0;
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 06462421a8..b218a8fe1e 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -2674,6 +2674,8 @@ void PrinceEngine::displayInventory() {
_mainHero->freeOldMove();
_secondHero->freeOldMove();
+ _interpreter->storeNewPC(0);
+
prepareInventoryToView();
while (!shouldQuit()) {
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp
index 9e380a27e8..e86c9fb68f 100644
--- a/engines/prince/script.cpp
+++ b/engines/prince/script.cpp
@@ -466,6 +466,10 @@ int Interpreter::getLastOPCode() {
return _lastOpcode;
}
+int Interpreter::getFgOpcodePC() {
+ return _fgOpcodePC;
+}
+
uint32 Interpreter::getCurrentString() {
return _currentString;
}
diff --git a/engines/prince/script.h b/engines/prince/script.h
index 80afe52cb6..04f125a8ea 100644
--- a/engines/prince/script.h
+++ b/engines/prince/script.h
@@ -187,6 +187,7 @@ public:
void step();
void storeNewPC(int opcodePC);
int getLastOPCode();
+ int getFgOpcodePC();
uint32 getCurrentString();
void setCurrentString(uint32 value);