From deba34cc05c8bf00de72a5db68e288d4a3584b27 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Feb 2017 15:42:34 -0500 Subject: TITANIC: Handle trying to put multiple brain cards in the same slot --- engines/titanic/carry/brain.cpp | 9 +++++++-- 1 file 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(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; -- cgit v1.2.3