aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-28 22:36:29 -0400
committerPaul Gilbert2016-07-28 22:36:29 -0400
commitc08ad39a9442d6f15bacb33b34597338121fa5b4 (patch)
tree31daf76f087d9c2eafbd44d84f6403d611cc8f53 /engines/titanic
parentc7bd63d8818bb064be19957c32a1ee4abe7c9515 (diff)
downloadscummvm-rg350-c08ad39a9442d6f15bacb33b34597338121fa5b4.tar.gz
scummvm-rg350-c08ad39a9442d6f15bacb33b34597338121fa5b4.tar.bz2
scummvm-rg350-c08ad39a9442d6f15bacb33b34597338121fa5b4.zip
TITANIC: Added DeskbotScript setFlags17
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/barbot_script.cpp19
-rw-r--r--engines/titanic/true_talk/deskbot_script.cpp20
2 files changed, 29 insertions, 10 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index f77b0b1b8a..1c652faf11 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -974,22 +974,23 @@ int BarbotScript::updateState(uint oldId, uint newId, int index) {
return 251701 + _field7C ? 3 : 0;
}
- for (const TTupdateState3 *us = &_states[0]; us->_newId; ++us) {
- if (us->_newId == newId) {
- if ((us->_dialBits & 1) && !getDialRegion(0))
+ for (uint idx = 0; idx < _states.size(); ++idx) {
+ const TTupdateState3 &us = _states[idx];
+ if (us._newId == newId) {
+ if ((us._dialBits & 1) && !getDialRegion(0))
continue;
- if ((us->_dialBits & 2) && getDialRegion(0))
+ if ((us._dialBits & 2) && getDialRegion(0))
continue;
- if ((us->_dialBits & 4) && !getDialRegion(1))
+ if ((us._dialBits & 4) && !getDialRegion(1))
continue;
- if ((us->_dialBits & 8) && getDialRegion(1))
+ if ((us._dialBits & 8) && getDialRegion(1))
continue;
- if ((us->_dialBits & 0x10) && !getDialRegion(2))
+ if ((us._dialBits & 0x10) && !getDialRegion(2))
continue;
- if ((us->_dialBits & 0x20) && getDialRegion(2))
+ if ((us._dialBits & 0x20) && getDialRegion(2))
continue;
- setState(us->_newValue);
+ setState(us._newValue);
break;
}
}
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 219ac74a24..1e3eaae26a 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -397,7 +397,25 @@ int DeskbotScript::getStateDialogueId() const {
}
void DeskbotScript::setFlags17(int newId, int index) {
- // TODO
+ int newValue = getValue(17);
+
+ for (uint idx = 0; idx < _states.size(); ++idx) {
+ const TTupdateState3 &us = _states[idx];
+ if (newId == (idx == 0 ? 0 : us._newId)) {
+ uint bits = us._dialBits;
+
+ if (!bits
+ || (index == 1 && (bits & 1) && (bits & 4))
+ || (index == 0 && (bits & 2) && (bits & 4))
+ || (index == 3 && (bits & 1) && (bits & 8))
+ || (index == 2 && (bits & 2) && (bits & 8))) {
+ newValue = us._newValue;
+ break;
+ }
+ }
+ }
+
+ CTrueTalkManager::setFlags(17, newValue);
}
} // End of namespace Titanic