aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/carry/brain.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-20 09:26:09 -0500
committerPaul Gilbert2017-02-20 09:26:09 -0500
commit2963af577505325dc578bad096d64499e0823a34 (patch)
tree876a0adcdf6b4696ea74e92bbc4e709025242bbc /engines/titanic/carry/brain.cpp
parent9ed2977f1fc6f9bf3aa87dfb8fd0e5869fbdd006 (diff)
downloadscummvm-rg350-2963af577505325dc578bad096d64499e0823a34.tar.gz
scummvm-rg350-2963af577505325dc578bad096d64499e0823a34.tar.bz2
scummvm-rg350-2963af577505325dc578bad096d64499e0823a34.zip
TITANIC: Fix adding centre cards to Titania
Diffstat (limited to 'engines/titanic/carry/brain.cpp')
-rw-r--r--engines/titanic/carry/brain.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index 7b2e8d0e45..49178d1e10 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -56,28 +56,25 @@ void CBrain::load(SimpleFile *file) {
bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CBrainSlot *slot = dynamic_cast<CBrainSlot *>(msg->_other);
- if (slot) {
- if (slot->getName() == "CentralCore") {
- setVisible(false);
- petMoveToHiddenRoom();
- CAddHeadPieceMsg headpieceMsg(getName());
- headpieceMsg.execute("CentralCoreSlot");
- }
- else if (!slot->_value1 && slot->getName() == "CentralCoreSlot") {
- setVisible(false);
- petMoveToHiddenRoom();
- CAddHeadPieceMsg headpieceMsg(getName());
- headpieceMsg.execute(msg->_other);
- playSound("z#116.wav");
- setPosition(Point(0, 0));
- setVisible(false);
- _field134 = 1;
- }
-
- return true;
- } else {
+ if (!slot) {
return CCarry::UseWithOtherMsg(msg);
+ } else if (isEquals("CentralCore")) {
+ setVisible(false);
+ petMoveToHiddenRoom();
+ CAddHeadPieceMsg headpieceMsg(getName());
+ headpieceMsg.execute("CentralCoreSlot");
+ } else if (!slot->_occupied && slot->getName() != "CentralCoreSlot") {
+ setVisible(false);
+ petMoveToHiddenRoom();
+ CAddHeadPieceMsg headpieceMsg(getName());
+ headpieceMsg.execute(msg->_other);
+ playSound("z#116.wav");
+ setPosition(Point(0, 0));
+ setVisible(false);
+ _field134 = 1;
}
+
+ return true;
}
bool CBrain::VisibleMsg(CVisibleMsg *msg) {