[Scummvm-git-logs] scummvm master -> 32510743edc13907679958eff27ef5759b9dc53b
dreammaster
paulfgilbert at gmail.com
Sun Nov 29 19:29:44 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6e2b31512e TITANIC: Renaming of CSummonBots fields
32510743ed TITANIC: Don't allow bots to appear when looking down well
Commit: 6e2b31512e313a1e4c7e94e38acef34551127f39
https://github.com/scummvm/scummvm/commit/6e2b31512e313a1e4c7e94e38acef34551127f39
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-11-29T11:27:49-08:00
Commit Message:
TITANIC: Renaming of CSummonBots fields
Changed paths:
engines/titanic/npcs/summon_bots.cpp
engines/titanic/npcs/summon_bots.h
diff --git a/engines/titanic/npcs/summon_bots.cpp b/engines/titanic/npcs/summon_bots.cpp
index 3a4cccaa4a..ef79bc9439 100644
--- a/engines/titanic/npcs/summon_bots.cpp
+++ b/engines/titanic/npcs/summon_bots.cpp
@@ -29,34 +29,34 @@ BEGIN_MESSAGE_MAP(CSummonBots, CRobotController)
ON_MESSAGE(SummonBotMsg)
END_MESSAGE_MAP()
-CSummonBots::CSummonBots() : CRobotController(), _string2("NULL"),
- _fieldC8(0), _fieldCC(0) {
+CSummonBots::CSummonBots() : CRobotController(), _validSummonLocations("NULL"),
+ _canSummonBellbot(0), _canSummonDoorbot(0) {
}
void CSummonBots::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldC8, indent);
- file->writeNumberLine(_fieldCC, indent);
- file->writeQuotedLine(_string2, indent);
+ file->writeNumberLine(_canSummonBellbot, indent);
+ file->writeNumberLine(_canSummonDoorbot, indent);
+ file->writeQuotedLine(_validSummonLocations, indent);
CRobotController::save(file, indent);
}
void CSummonBots::load(SimpleFile *file) {
file->readNumber();
- _fieldC8 = file->readNumber();
- _fieldCC = file->readNumber();
- _string2 = file->readString();
+ _canSummonBellbot = file->readNumber();
+ _canSummonDoorbot = file->readNumber();
+ _validSummonLocations = file->readString();
CRobotController::load(file);
}
bool CSummonBots::SummonBotQueryMsg(CSummonBotQueryMsg *msg) {
if (msg->_npcName == "BellBot") {
- if (_fieldC8 && !petCheckNode(_string2))
+ if (_canSummonBellbot && !petCheckNode(_validSummonLocations))
return true;
} else if (msg->_npcName == "DoorBot") {
- if (_fieldCC && !petCheckNode(_string2))
+ if (_canSummonDoorbot && !petCheckNode(_validSummonLocations))
return true;
}
@@ -65,13 +65,13 @@ bool CSummonBots::SummonBotQueryMsg(CSummonBotQueryMsg *msg) {
bool CSummonBots::SummonBotMsg(CSummonBotMsg *msg) {
if (msg->_npcName == "BellBot") {
- if (!_fieldC8)
+ if (!_canSummonBellbot)
return false;
if (!petDismissBot("BellBot"))
petOnSummonBot("Bellbot", msg->_value);
} else if (msg->_npcName == "DoorBot") {
- if (!_fieldCC)
+ if (!_canSummonDoorbot)
return false;
if (!petDismissBot("Doorbot"))
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
index 367f62365b..3aaf61bf6c 100644
--- a/engines/titanic/npcs/summon_bots.h
+++ b/engines/titanic/npcs/summon_bots.h
@@ -32,9 +32,9 @@ class CSummonBots : public CRobotController {
bool SummonBotQueryMsg(CSummonBotQueryMsg *msg);
bool SummonBotMsg(CSummonBotMsg *msg);
protected:
- CString _string2;
- int _fieldC8;
- int _fieldCC;
+ CString _validSummonLocations;
+ bool _canSummonBellbot;
+ bool _canSummonDoorbot;
public:
CLASSDEF;
CSummonBots();
Commit: 32510743edc13907679958eff27ef5759b9dc53b
https://github.com/scummvm/scummvm/commit/32510743edc13907679958eff27ef5759b9dc53b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-11-29T11:27:49-08:00
Commit Message:
TITANIC: Don't allow bots to appear when looking down well
Changed paths:
engines/titanic/core/game_object.cpp
engines/titanic/core/game_object.h
engines/titanic/game/idle_summoner.cpp
engines/titanic/pet_control/pet_control.cpp
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d75bca0a7e..91537c8775 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1471,6 +1471,16 @@ int CGameObject::getRandomNumber(int max, int *oldVal) {
}
}
+bool CGameObject::isBotDisallowedLocation() {
+ // 1) At the Embarkation SuccUBus
+ // 2) in front of the Deskbot's desk
+ // 3) When in the Gondola
+ // 4) At the top of the well
+ CString fullName = getFullViewName();
+ return fullName == "EmbLobby.Node 2.W" || fullName == "EmbLobby.Node 4.E" ||
+ fullName == "TopOfWell.Node 29.N" || fullName == "TopOfWell.Node 21.S";
+}
+
/*------------------------------------------------------------------------*/
CRoomItem *CGameObject::getRoom() const {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 9f5ab167ae..467c03b8e2 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -547,6 +547,13 @@ protected:
* Gets a new random number
*/
int getRandomNumber(int max, int *oldVal = nullptr);
+
+ /**
+ * Returns true if the current location is one that Doorbot/Bellbot
+ * shouldn't be allowed to be summoned to, but isn't disallowed by
+ * the original game
+ */
+ bool isBotDisallowedLocation();
public:
Rect _bounds;
bool _isPendingMail;
diff --git a/engines/titanic/game/idle_summoner.cpp b/engines/titanic/game/idle_summoner.cpp
index 81192db0a3..e16929f423 100644
--- a/engines/titanic/game/idle_summoner.cpp
+++ b/engines/titanic/game/idle_summoner.cpp
@@ -81,12 +81,8 @@ bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
if (!compareRoomNameTo("TopOfWell") && !compareRoomNameTo("EmbLobby"))
return true;
- // WORKAROUND: To benefit the players, don't allow the bots to turn up
- // when at the Embarkation SuccUBus, in front of the Deskbot's desk,
- // or when in the Gondola, since it just looks weird
- CString fullName = getFullViewName();
- if (fullName == "EmbLobby.Node 2.W" || fullName == "EmbLobby.Node 4.E" ||
- fullName == "TopOfWell.Node 29.N")
+ // WORKAROUND: Handle special disallowed locations
+ if (isBotDisallowedLocation())
return true;
int region = talkGetDialRegion("BellBot", 1);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index b3291623c3..824ac4c92f 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -588,6 +588,10 @@ int CPetControl::canSummonBot(const CString &name) {
if (!room)
return SUMMON_CANT;
+ // WORKAROUND: Handle special disallowed locations
+ if (isBotDisallowedLocation())
+ return SUMMON_CANT;
+
// Query current room to see whether the bot can be summoned to it
CSummonBotQueryMsg queryMsg(name);
return queryMsg.execute(room) ? SUMMON_CAN : SUMMON_CANT;
More information about the Scummvm-git-logs
mailing list