diff options
-rw-r--r-- | engines/titanic/game/sgt/bedhead.cpp | 55 | ||||
-rw-r--r-- | engines/titanic/game/sgt/sgt_tv.cpp | 2 |
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; |