aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-18 23:00:02 -0500
committerPaul Gilbert2017-02-18 23:00:02 -0500
commitd8418f8c10156704a2fae42f9e50386b8f67b501 (patch)
tree2872b88add2bdc548e1448f25f7dc4a5f3aa4441 /engines
parent66f3458a2be4a9a490b406a4e9a100be43849725 (diff)
downloadscummvm-rg350-d8418f8c10156704a2fae42f9e50386b8f67b501.tar.gz
scummvm-rg350-d8418f8c10156704a2fae42f9e50386b8f67b501.tar.bz2
scummvm-rg350-d8418f8c10156704a2fae42f9e50386b8f67b501.zip
TITANIC: Workaround for using magazine on incorrect objects
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/carry/magazine.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
index e68c63f8f9..94e853bda9 100644
--- a/engines/titanic/carry/magazine.cpp
+++ b/engines/titanic/carry/magazine.cpp
@@ -52,19 +52,18 @@ void CMagazine::load(SimpleFile *file) {
}
bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) {
+ // WORKAROUND: Slight difference to original to ensure that when the
+ // magazine is used on an incorrect char, it's returned to inventory
CDeskbot *deskbot = dynamic_cast<CDeskbot *>(msg->_character);
- if (deskbot) {
- if (deskbot->_deskbotActive) {
- setVisible(false);
- setPosition(Point(1000, 1000));
- CActMsg actMsg("2ndClassUpgrade");
- actMsg.execute("Deskbot");
- }
-
+ if (deskbot && deskbot->_deskbotActive) {
+ setVisible(false);
+ setPosition(Point(1000, 1000));
+ CActMsg actMsg("2ndClassUpgrade");
+ actMsg.execute("Deskbot");
return true;
- } else {
- return CCarry::UseWithCharMsg(msg);
}
+
+ return CCarry::UseWithCharMsg(msg);
}
bool CMagazine::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
@@ -77,17 +76,20 @@ bool CMagazine::VisibleMsg(CVisibleMsg *msg) {
}
bool CMagazine::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+ // WORKAROUND: Slight difference to original to ensure that when the
+ // magazine is used on an incorrect object, it's returned to inventory
if (msg->_other->getName() == "SwitchOnDeskbot") {
- // TODO: other _field108 if
- if (false) {
+ CDeskbot *deskbot = dynamic_cast<CDeskbot *>(msg->_other);
+ if (deskbot && deskbot->_deskbotActive) {
setVisible(false);
setPosition(Point(1000, 1000));
CActMsg actMsg("2ndClassUpgrade");
actMsg.execute("Deskbot");
+ return true;
}
}
- return true;
+ return CCarry::UseWithOtherMsg(msg);
}
} // End of namespace Titanic