diff options
author | Paul Gilbert | 2017-01-15 16:22:15 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-15 16:22:15 -0500 |
commit | 3fa46888a81cee152aa064036e62081b403c2053 (patch) | |
tree | d4a800b30862b45d37324c64db7efc643e19a1a4 /engines/titanic | |
parent | 988e47d2d0ec0b803dbd20b7018b792952ac9b3a (diff) | |
download | scummvm-rg350-3fa46888a81cee152aa064036e62081b403c2053.tar.gz scummvm-rg350-3fa46888a81cee152aa064036e62081b403c2053.tar.bz2 scummvm-rg350-3fa46888a81cee152aa064036e62081b403c2053.zip |
TITANIC: Fixes for getting chicken and starling puret
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/carry/glass.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/game_object.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/sauce_dispensor.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/game/sauce_dispensor.h | 2 |
4 files changed, 13 insertions, 9 deletions
diff --git a/engines/titanic/carry/glass.cpp b/engines/titanic/carry/glass.cpp index d57c63d0bb..6751d8456d 100644 --- a/engines/titanic/carry/glass.cpp +++ b/engines/titanic/carry/glass.cpp @@ -135,7 +135,7 @@ bool CGlass::MouseDragEndMsg(CMouseDragEndMsg *msg) { CUseWithCharMsg useMsg(npc); useMsg.execute(this); } else { - CUseWithOtherMsg otherMsg(npc); + CUseWithOtherMsg otherMsg(msg->_dropTarget); otherMsg.execute(this); } } diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 2b327960fe..bcdf77b675 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -1511,6 +1511,8 @@ void CGameObject::petAddToCarryParcel(CGameObject *obj) { } void CGameObject::petAddToInventory() { + assert(dynamic_cast<CCarry *>(this)); + CPetControl *pet = getPetControl(); if (pet) { makeDirty(); diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp index e4cb0554e7..b58de99a62 100644 --- a/engines/titanic/game/sauce_dispensor.cpp +++ b/engines/titanic/game/sauce_dispensor.cpp @@ -36,13 +36,13 @@ BEGIN_MESSAGE_MAP(CSauceDispensor, CBackground) END_MESSAGE_MAP() CSauceDispensor::CSauceDispensor() : CBackground(), - _fieldEC(0), _fieldF0(0), _field104(0), _field108(0) { + _pouringCondiment(false), _fieldF0(0), _field104(0), _field108(0) { } void CSauceDispensor::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeQuotedLine(_string3, indent); - file->writeNumberLine(_fieldEC, indent); + file->writeNumberLine(_pouringCondiment, indent); file->writeNumberLine(_fieldF0, indent); file->writePoint(_pos1, indent); file->writePoint(_pos2, indent); @@ -55,7 +55,7 @@ void CSauceDispensor::save(SimpleFile *file, int indent) { void CSauceDispensor::load(SimpleFile *file) { file->readNumber(); _string3 = file->readString(); - _fieldEC = file->readNumber(); + _pouringCondiment = file->readNumber(); _fieldF0 = file->readNumber(); _pos1 = file->readPoint(); _pos2 = file->readPoint(); @@ -80,6 +80,7 @@ bool CSauceDispensor::Use(CUse *msg) { } else { setVisible(true); if (chicken->_field12C) { + _pouringCondiment = true; playMovie(_pos1.x, _pos1.y, MOVIE_NOTIFY_OBJECT); } else { CActMsg actMsg(_string3); @@ -99,13 +100,14 @@ bool CSauceDispensor::Use(CUse *msg) { petDisplayMessage(1, DISPENSOR_IS_EMPTY); } else if (msg->_item->isEquals("BeerGlass")) { CGlass *glass = dynamic_cast<CGlass *>(msg->_item); + assert(glass); _field108 = true; - if (_field104 || _fieldF0) { - petAddToInventory(); + if (_field104 != 1 || _fieldF0 != 1) { + glass->petAddToInventory(); } else if (glass->_condiment != "None") { visibleMsg.execute("BeerGlass"); - } else if (_fieldEC) { + } else if (_pouringCondiment) { glass->setPosition(Point( _bounds.left + (_bounds.width() / 2) - (glass->_bounds.width() / 2), 300)); @@ -121,7 +123,7 @@ bool CSauceDispensor::Use(CUse *msg) { bool CSauceDispensor::MovieEndMsg(CMovieEndMsg *msg) { setVisible(false); - _fieldEC = false; + _pouringCondiment = false; CActMsg actMsg("GoToPET"); if (_field104) diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h index f8021f368b..cdcd592546 100644 --- a/engines/titanic/game/sauce_dispensor.h +++ b/engines/titanic/game/sauce_dispensor.h @@ -37,7 +37,7 @@ class CSauceDispensor : public CBackground { bool StatusChangeMsg(CStatusChangeMsg *msg); public: CString _string3; - int _fieldEC; + bool _pouringCondiment; int _fieldF0; Point _pos1; Point _pos2; |