From 85fcfb9a54505dd88a6b3d4354d54a04558e05ea Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 16 Nov 2016 21:02:25 -0500 Subject: TITANIC: Fixes for TV and Bedhead open/close --- engines/titanic/game/sgt/bedhead.cpp | 55 ++++++++++++++++++------------------ engines/titanic/game/sgt/sgt_tv.cpp | 2 +- 2 files changed, 28 insertions(+), 29 deletions(-) (limited to 'engines/titanic') 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; -- cgit v1.2.3