diff options
author | Paul Gilbert | 2017-01-15 11:42:58 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-15 11:42:58 -0500 |
commit | 3327b9ce8dd030e963d03a98de63def7344e1808 (patch) | |
tree | d2c7608391e62a85f6c5d0097f487153faaca769 /engines | |
parent | 03765dbf183e0cea8bc5edbd336f2be280d6df43 (diff) | |
download | scummvm-rg350-3327b9ce8dd030e963d03a98de63def7344e1808.tar.gz scummvm-rg350-3327b9ce8dd030e963d03a98de63def7344e1808.tar.bz2 scummvm-rg350-3327b9ce8dd030e963d03a98de63def7344e1808.zip |
TITANIC: Fix using chicken on dispensors
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/carry/chicken.cpp | 31 | ||||
-rw-r--r-- | engines/titanic/carry/chicken.h | 2 | ||||
-rw-r--r-- | engines/titanic/carry/glass.cpp | 32 | ||||
-rw-r--r-- | engines/titanic/carry/glass.h | 2 | ||||
-rw-r--r-- | engines/titanic/carry/napkin.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/sauce_dispensor.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/npcs/bilge_succubus.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 2 |
8 files changed, 39 insertions, 38 deletions
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp index b80096b718..e0ca055a9c 100644 --- a/engines/titanic/carry/chicken.cpp +++ b/engines/titanic/carry/chicken.cpp @@ -28,6 +28,7 @@ namespace Titanic { BEGIN_MESSAGE_MAP(CChicken, CCarry) + ON_MESSAGE(UseWithOtherMsg) ON_MESSAGE(UseWithCharMsg) ON_MESSAGE(ActMsg) ON_MESSAGE(VisibleMsg) @@ -41,14 +42,14 @@ END_MESSAGE_MAP() int CChicken::_v1; -CChicken::CChicken() : CCarry(), _string6("None"), +CChicken::CChicken() : CCarry(), _condiment("None"), _field12C(1), _field13C(0), _timerId(0) { } void CChicken::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_field12C, indent); - file->writeQuotedLine(_string6, indent); + file->writeQuotedLine(_condiment, indent); file->writeNumberLine(_v1, indent); file->writeNumberLine(_field13C, indent); file->writeNumberLine(_timerId, indent); @@ -59,7 +60,7 @@ void CChicken::save(SimpleFile *file, int indent) { void CChicken::load(SimpleFile *file) { file->readNumber(); _field12C = file->readNumber(); - _string6 = file->readString(); + _condiment = file->readString(); _v1 = file->readNumber(); _field13C = file->readNumber(); _timerId = file->readNumber(); @@ -69,7 +70,7 @@ void CChicken::load(SimpleFile *file) { bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) { if (msg->_other->getName() == "Napkin") { - if (_field12C || _string6 == "None") { + if (_field12C || _condiment == "None") { CActMsg actMsg("Clean"); actMsg.execute(this); petAddToInventory(); @@ -81,12 +82,12 @@ bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) { petAddToInventory(); } else { CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other); - if (!dispensor || _string6 == "None") { - return CCarry::UseWithOtherMsg(msg); - } else { + if (dispensor && _condiment == "None") { setVisible(false); CUse use(this); use.execute(msg->_other); + } else { + return CCarry::UseWithOtherMsg(msg); } } @@ -112,27 +113,27 @@ bool CChicken::ActMsg(CActMsg *msg) { setVisible(true); petAddToInventory(); } else if (msg->_action == "Tomato") { - _string6 = "Tomato"; + _condiment = "Tomato"; loadFrame(4); _visibleFrame = 4; } else if (msg->_action == "Mustard") { - _string6 = "Mustard"; + _condiment = "Mustard"; loadFrame(5); _visibleFrame = 5; } else if (msg->_action == "Bird") { - _string6 = "Bird"; + _condiment = "Bird"; loadFrame(2); _visibleFrame = 2; } else if (msg->_action == "None") { setVisible(false); } else if (msg->_action == "Clean") { - _string6 = "None"; + _condiment = "None"; loadFrame(3); _field12C = 0; _visibleFrame = 3; } else if (msg->_action == "Dispense Chicken") { - _string6 = "None"; + _condiment = "None"; _field13C = 0; _field12C = 1; loadFrame(1); @@ -188,11 +189,11 @@ bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) { if (_v1 > 0) msg->_value1 = 1; - if (_string6 == "Tomato") { + if (_condiment == "Tomato") { msg->_value2 = 1; - } else if (_string6 == "Mustard") { + } else if (_condiment == "Mustard") { msg->_value2 = 2; - } else if (_string6 == "Bird") { + } else if (_condiment == "Bird") { msg->_value2 = 3; } diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h index e64ae458a4..47d25b39a4 100644 --- a/engines/titanic/carry/chicken.h +++ b/engines/titanic/carry/chicken.h @@ -45,7 +45,7 @@ public: static int _v1; public: int _field12C; - CString _string6; + CString _condiment; int _field13C; int _timerId; public: diff --git a/engines/titanic/carry/glass.cpp b/engines/titanic/carry/glass.cpp index ff4c54ca39..05c8d111b5 100644 --- a/engines/titanic/carry/glass.cpp +++ b/engines/titanic/carry/glass.cpp @@ -36,18 +36,18 @@ BEGIN_MESSAGE_MAP(CGlass, CCarry) ON_MESSAGE(TurnOff) END_MESSAGE_MAP() -CGlass::CGlass() : CCarry(), _string6("None") { +CGlass::CGlass() : CCarry(), _condiment("None") { } void CGlass::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string6, indent); + file->writeQuotedLine(_condiment, indent); CCarry::save(file, indent); } void CGlass::load(SimpleFile *file) { file->readNumber(); - _string6 = file->readString(); + _condiment = file->readString(); CCarry::load(file); } @@ -55,25 +55,25 @@ bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) { CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other); CChicken *chicken = dynamic_cast<CChicken *>(msg->_other); - if (dispensor && _string6 != "None") { + if (dispensor && _condiment == "None") { CUse useMsg(this); useMsg.execute(dispensor); - } else if (msg->_other->isEquals("Chicken") && _string6 != "None") { - if (chicken->_string6 != "None") { + } else if (msg->_other->isEquals("Chicken") && _condiment == "None") { + if (chicken->_condiment != "None") { if (!chicken->_field12C) { - CActMsg actMsg(_string6); + CActMsg actMsg(_condiment); actMsg.execute("Chicken"); } - _string6 = "None"; + _condiment = "None"; loadFrame(0); _visibleFrame = 0; } petAddToInventory(); - } else if (msg->_other->isEquals("Napkin") && _string6 != "None") { + } else if (msg->_other->isEquals("Napkin") && _condiment == "None") { petAddToInventory(); - _string6 = "None"; + _condiment = "None"; loadFrame(0); _visibleFrame = 0; } else { @@ -85,10 +85,10 @@ bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) { bool CGlass::UseWithCharMsg(CUseWithCharMsg *msg) { if (msg->_character->isEquals("Barbot") && msg->_character->_visible) { - CActMsg actMsg(_string6); + CActMsg actMsg(_condiment); setVisible(false); - if (_string6 != "Bird") + if (_condiment != "Bird") setPosition(_origPos); actMsg.execute(msg->_character); @@ -104,19 +104,19 @@ bool CGlass::ActMsg(CActMsg *msg) { setVisible(true); petAddToInventory(); } else if (msg->_action == "Mustard") { - _string6 = "Mustard"; + _condiment = "Mustard"; loadFrame(1); _visibleFrame = 1; } else if (msg->_action == "Tomato") { - _string6 = "Tomato"; + _condiment = "Tomato"; loadFrame(2); _visibleFrame = 2; } else if (msg->_action == "Bird") { - _string6 = "Bird"; + _condiment = "Bird"; loadFrame(3); _visibleFrame = 3; } else if (msg->_action == "InTitilator") { - _string6 = "None"; + _condiment = "None"; loadFrame(0); _visibleFrame = 0; } diff --git a/engines/titanic/carry/glass.h b/engines/titanic/carry/glass.h index 608d45cb66..c6f7f3d6bf 100644 --- a/engines/titanic/carry/glass.h +++ b/engines/titanic/carry/glass.h @@ -36,7 +36,7 @@ class CGlass : public CCarry { bool TurnOn(CTurnOn *msg); bool TurnOff(CTurnOff *msg); public: - CString _string6; + CString _condiment; public: CLASSDEF; CGlass(); diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp index 3996ca7c74..eaafd8b34c 100644 --- a/engines/titanic/carry/napkin.cpp +++ b/engines/titanic/carry/napkin.cpp @@ -45,7 +45,7 @@ void CNapkin::load(SimpleFile *file) { bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) { CChicken *chicken = dynamic_cast<CChicken *>(msg->_other); if (chicken) { - if (chicken->_string6 == "None" || chicken->_field12C) { + if (chicken->_condiment == "None" || chicken->_field12C) { CActMsg actMsg("Clean"); actMsg.execute("Chicken"); } else { diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp index 7010d00be1..e4cb0554e7 100644 --- a/engines/titanic/game/sauce_dispensor.cpp +++ b/engines/titanic/game/sauce_dispensor.cpp @@ -74,7 +74,7 @@ bool CSauceDispensor::Use(CUse *msg) { if (_fieldF0) { playSound("b#15.wav", 50); - if (chicken->_string6 != "None") { + if (chicken->_condiment != "None") { petDisplayMessage(1, FOODSTUFF_ALREADY_GARNISHED); msg->execute("Chicken"); } else { @@ -103,7 +103,7 @@ bool CSauceDispensor::Use(CUse *msg) { if (_field104 || _fieldF0) { petAddToInventory(); - } else if (glass->_string6 != "None") { + } else if (glass->_condiment != "None") { visibleMsg.execute("BeerGlass"); } else if (_fieldEC) { glass->setPosition(Point( diff --git a/engines/titanic/npcs/bilge_succubus.cpp b/engines/titanic/npcs/bilge_succubus.cpp index 36627842a5..628f2eb24b 100644 --- a/engines/titanic/npcs/bilge_succubus.cpp +++ b/engines/titanic/npcs/bilge_succubus.cpp @@ -337,7 +337,7 @@ bool CBilgeSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) { playSound("z#23.wav"); CChicken *chicken = dynamic_cast<CChicken *>(item); - bool chickenFlag = chicken ? chicken->_string6 == "None" : false; + bool chickenFlag = chicken ? chicken->_condiment == "None" : false; if (chickenFlag) { if (_okStartFrame >= 0) { diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp index a05cc71d00..1d8e0e4f13 100644 --- a/engines/titanic/npcs/succubus.cpp +++ b/engines/titanic/npcs/succubus.cpp @@ -281,7 +281,7 @@ bool CSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) { pet->phonographAction(""); CChicken *chicken = dynamic_cast<CChicken *>(item); - bool chickenFlag = chicken ? chicken->_string6 != "None" : false; + bool chickenFlag = chicken ? chicken->_condiment != "None" : false; item->setVisible(false); if (_startFrame1 >= 0) { |