diff options
author | Paul Gilbert | 2017-02-20 15:42:34 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-20 15:42:34 -0500 |
commit | deba34cc05c8bf00de72a5db68e288d4a3584b27 (patch) | |
tree | 8008efc4d305d4264e9c9ecf46a5bced6497fc1a /engines/titanic/carry | |
parent | 52dbc31370ad4a2d0f4ff6993ea4aeffdd23b4bd (diff) | |
download | scummvm-rg350-deba34cc05c8bf00de72a5db68e288d4a3584b27.tar.gz scummvm-rg350-deba34cc05c8bf00de72a5db68e288d4a3584b27.tar.bz2 scummvm-rg350-deba34cc05c8bf00de72a5db68e288d4a3584b27.zip |
TITANIC: Handle trying to put multiple brain cards in the same slot
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r-- | engines/titanic/carry/brain.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp index 09ebd42724..73970c404c 100644 --- a/engines/titanic/carry/brain.cpp +++ b/engines/titanic/carry/brain.cpp @@ -56,14 +56,16 @@ void CBrain::load(SimpleFile *file) { bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) { CBrainSlot *slot = dynamic_cast<CBrainSlot *>(msg->_other); - if (!slot) { + if (!slot) return CCarry::UseWithOtherMsg(msg); - } else if (isEquals("CentralCore")) { + + if (isEquals("CentralCore")) { setVisible(false); petMoveToHiddenRoom(); CAddHeadPieceMsg headpieceMsg(getName()); headpieceMsg.execute("CentralCoreSlot"); } else if (!slot->_occupied && slot->getName() != "CentralCoreSlot") { + // Brain card goes into vacant slot setVisible(false); petMoveToHiddenRoom(); CAddHeadPieceMsg headpieceMsg(getName()); @@ -72,6 +74,9 @@ bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) { setPosition(Point(0, 0)); setVisible(false); _pieceAdded = true; + } else { + // Trying to put brain card into an already occupied slot + petAddToInventory(); } return true; |