aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/npcs
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-25 19:03:55 -0400
committerPaul Gilbert2017-08-25 19:03:55 -0400
commitc4bf8575c1740ffca017b7c3e731944747726d00 (patch)
tree37b90a483525b9dfe4e3ffc18cb9acaa1c9484dd /engines/titanic/npcs
parent8e62240ed95acd53187815299f105cf7924a12c4 (diff)
downloadscummvm-rg350-c4bf8575c1740ffca017b7c3e731944747726d00.tar.gz
scummvm-rg350-c4bf8575c1740ffca017b7c3e731944747726d00.tar.bz2
scummvm-rg350-c4bf8575c1740ffca017b7c3e731944747726d00.zip
TITANIC: Fix Door/Bellbot remaining when summoned outside doors
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r--engines/titanic/npcs/bellbot.cpp11
-rw-r--r--engines/titanic/npcs/bellbot.h1
-rw-r--r--engines/titanic/npcs/doorbot.cpp7
3 files changed, 19 insertions, 0 deletions
diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp
index 56420ba0de..c6c6a9e3a6 100644
--- a/engines/titanic/npcs/bellbot.cpp
+++ b/engines/titanic/npcs/bellbot.cpp
@@ -30,6 +30,7 @@ namespace Titanic {
BEGIN_MESSAGE_MAP(CBellBot, CTrueTalkNPC)
ON_MESSAGE(OnSummonBotMsg)
+ ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(Use)
@@ -98,6 +99,16 @@ bool CBellBot::OnSummonBotMsg(COnSummonBotMsg *msg) {
return true;
}
+bool CBellBot::EnterViewMsg(CEnterViewMsg *msg) {
+ // WORKAROUND: Calling bot in front of doors and then going through them
+ // can leave it in the view. Detect this and properly remove him when
+ // the player returns to that view
+ if (msg->_newView == getParent() && getPetControl()->canSummonBot("BellBot"))
+ petMoveToHiddenRoom();
+
+ return true;
+}
+
bool CBellBot::LeaveViewMsg(CLeaveViewMsg *msg) {
if (_npcFlags & NPCFLAG_MOVING) {
performAction(true);
diff --git a/engines/titanic/npcs/bellbot.h b/engines/titanic/npcs/bellbot.h
index c246901cfe..538c299b6e 100644
--- a/engines/titanic/npcs/bellbot.h
+++ b/engines/titanic/npcs/bellbot.h
@@ -30,6 +30,7 @@ namespace Titanic {
class CBellBot : public CTrueTalkNPC {
DECLARE_MESSAGE_MAP;
bool OnSummonBotMsg(COnSummonBotMsg *msg);
+ bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool Use(CUse *msg);
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index 391c60aba3..066191ed56 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -23,6 +23,7 @@
#include "titanic/npcs/doorbot.h"
#include "titanic/core/room_item.h"
#include "titanic/debugger.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
@@ -551,6 +552,12 @@ bool CDoorbot::TextInputMsg(CTextInputMsg *msg) {
}
bool CDoorbot::EnterViewMsg(CEnterViewMsg *msg) {
+ // WORKAROUND: Calling bot in front of doors and then going through them
+ // can leave it in the view. Detect this and properly remove him when
+ // the player returns to that view
+ if (msg->_newView == getParent() && getPetControl()->canSummonBot("DoorBot"))
+ petMoveToHiddenRoom();
+
if ((_npcFlags & NPCFLAG_DOORBOT_INTRO) && _introMovieNum == 7)
playClip("SE Move And Turn", MOVIE_NOTIFY_OBJECT);