aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-11-16 21:02:25 -0500
committerPaul Gilbert2016-11-16 21:02:25 -0500
commit85fcfb9a54505dd88a6b3d4354d54a04558e05ea (patch)
tree4eba92da70cca0265470963560391d4962c09036 /engines/titanic
parent391eecb98b3c5355d4feae9f4a199f50a6bca768 (diff)
downloadscummvm-rg350-85fcfb9a54505dd88a6b3d4354d54a04558e05ea.tar.gz
scummvm-rg350-85fcfb9a54505dd88a6b3d4354d54a04558e05ea.tar.bz2
scummvm-rg350-85fcfb9a54505dd88a6b3d4354d54a04558e05ea.zip
TITANIC: Fixes for TV and Bedhead open/close
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/game/sgt/bedhead.cpp55
-rw-r--r--engines/titanic/game/sgt/sgt_tv.cpp2
2 files changed, 28 insertions, 29 deletions
diff --git a/engines/titanic/game/sgt/bedhead.cpp b/engines/titanic/game/sgt/bedhead.cpp
index 028e8de7f0..b42c1c1146 100644
--- a/engines/titanic/game/sgt/bedhead.cpp
+++ b/engines/titanic/game/sgt/bedhead.cpp
@@ -87,34 +87,33 @@ void CBedhead::load(SimpleFile *file) {
}
bool CBedhead::TurnOn(CTurnOn *msg) {
- if (_statics->_bedfoot == "Closed" || _statics->_bedfoot == "RestingUnderTV")
- return true;
-
- const BedheadEntries *data = nullptr;
- if (_statics->_bedhead == "Closed")
- data = &_on._closed;
- else if (_statics->_bedhead == "RestingTV")
- data = &_on._restingTV;
- else if (_statics->_bedhead == "RestingUV")
- data = &_on._restingUV;
- else if (_statics->_bedhead == "ClosedWrong")
- data = &_on._closedWrong;
- else
- return true;
-
- for (uint idx = 0; idx < data->size(); ++idx) {
- const BedheadEntry &entry = (*data)[idx];
- if ((entry._name1 == _statics->_tv || entry._name1 == "Any")
- && (entry._name2 == _statics->_vase || entry._name2 == "Any")
- && (entry._name3 == _statics->_desk || entry._name3 == "Any")) {
- CVisibleMsg visibleMsg(false);
- visibleMsg.execute("Bedfoot");
- setVisible(true);
-
- _statics->_bedhead = entry._name4;
- playMovie(entry._startFrame, entry._endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
- playSound("b#6.wav");
- _isClosed = false;
+ if (_statics->_bedfoot != "Closed" && _statics->_bedfoot != "RestingUnderTV") {
+ const BedheadEntries *data = nullptr;
+ if (_statics->_bedhead == "Closed")
+ data = &_on._closed;
+ else if (_statics->_bedhead == "RestingTV")
+ data = &_on._restingTV;
+ else if (_statics->_bedhead == "RestingUV")
+ data = &_on._restingUV;
+ else if (_statics->_bedhead == "ClosedWrong")
+ data = &_on._closedWrong;
+ else
+ return true;
+
+ for (uint idx = 0; idx < data->size(); ++idx) {
+ const BedheadEntry &entry = (*data)[idx];
+ if ((entry._name1 == _statics->_tv || entry._name1 == "Any")
+ && (entry._name2 == _statics->_vase || entry._name2 == "Any")
+ && (entry._name3 == _statics->_desk || entry._name3 == "Any")) {
+ CVisibleMsg visibleMsg(false);
+ visibleMsg.execute("Bedfoot");
+ setVisible(true);
+
+ _statics->_bedhead = entry._name4;
+ playMovie(entry._startFrame, entry._endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ playSound("b#6.wav");
+ _isClosed = false;
+ }
}
}
diff --git a/engines/titanic/game/sgt/sgt_tv.cpp b/engines/titanic/game/sgt/sgt_tv.cpp
index d2ed0da18b..ebec334781 100644
--- a/engines/titanic/game/sgt/sgt_tv.cpp
+++ b/engines/titanic/game/sgt/sgt_tv.cpp
@@ -54,7 +54,7 @@ bool CSGTTV::TurnOff(CTurnOff *msg) {
bool CSGTTV::TurnOn(CTurnOn *msg) {
if (CSGTStateRoom::_statics->_tv == "Closed" &&
- CSGTStateRoom::_statics->_bedfoot == "Closed") {
+ CSGTStateRoom::_statics->_bedfoot != "Closed") {
CSGTStateRoom::_statics->_tv = "Open";
setVisible(true);
_isClosed = false;