[Scummvm-git-logs] scummvm master -> 96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60

dreammaster dreammaster at scummvm.org
Sun Jul 23 03:56:54 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
96a1b70700 TITANIC: Fixes for CIdleSummoner to summon Bellbot or Doorbot


Commit: 96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60
    https://github.com/scummvm/scummvm/commit/96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-22T21:56:46-04:00

Commit Message:
TITANIC: Fixes for CIdleSummoner to summon Bellbot or Doorbot

Changed paths:
    engines/titanic/game/idle_summoner.cpp
    engines/titanic/game/idle_summoner.h


diff --git a/engines/titanic/game/idle_summoner.cpp b/engines/titanic/game/idle_summoner.cpp
index 0e3604a..ed0a3d0 100644
--- a/engines/titanic/game/idle_summoner.cpp
+++ b/engines/titanic/game/idle_summoner.cpp
@@ -33,7 +33,7 @@ END_MESSAGE_MAP()
 
 CIdleSummoner::CIdleSummoner() : CGameObject(), _fieldBC(360000),
 		_fieldC0(60000), _fieldC4(360000), _fieldC8(60000),
-		_fieldCC(0), _fieldD0(0), _fieldD4(0), _fieldD8(0), _ticks(0) {
+		_fieldCC(0), _fieldD0(0), _timerId(0), _oldNodesCtr(0), _ticks(0) {
 }
 
 void CIdleSummoner::save(SimpleFile *file, int indent) {
@@ -44,8 +44,8 @@ void CIdleSummoner::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_fieldC8, indent);
 	file->writeNumberLine(_fieldCC, indent);
 	file->writeNumberLine(_fieldD0, indent);
-	file->writeNumberLine(_fieldD4, indent);
-	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_timerId, indent);
+	file->writeNumberLine(_oldNodesCtr, indent);
 	file->writeNumberLine(_ticks, indent);
 
 	CGameObject::save(file, indent);
@@ -59,8 +59,8 @@ void CIdleSummoner::load(SimpleFile *file) {
 	_fieldC8 = file->readNumber();
 	_fieldCC = file->readNumber();
 	_fieldD0 = file->readNumber();
-	_fieldD4 = file->readNumber();
-	_fieldD8 = file->readNumber();
+	_timerId = file->readNumber();
+	_oldNodesCtr = file->readNumber();
 	_ticks = file->readNumber();
 
 	CGameObject::load(file);
@@ -75,7 +75,7 @@ bool CIdleSummoner::EnterViewMsg(CEnterViewMsg *msg) {
 bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
 	uint nodesCtr = getNodeChangedCtr();
 	if (msg->_actionVal == 1 && !petDoorOrBellbotPresent()
-			&& nodesCtr > 0 && _fieldD8) {
+			&& nodesCtr > 0 && nodesCtr != _oldNodesCtr) {
 		if (!compareRoomNameTo("TopOfWell") && !compareRoomNameTo("EmbLobby"))
 			return true;
 
@@ -91,13 +91,14 @@ bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
 			} else {
 				name = "DoorBot";
 			}
-			_fieldD8 = nodesCtr;
+			_oldNodesCtr = nodesCtr;
 
-			if (getRoom()) {
+			CRoomItem *room = getRoom();
+			if (room) {
 				CSummonBotQueryMsg queryMsg(name);
-				if (queryMsg.execute(this)) {
+				if (queryMsg.execute(room)) {
 					CSummonBotMsg summonMsg(name, 1);
-					summonMsg.execute(this);
+					summonMsg.execute(room);
 				}
 			}
 		}
@@ -108,12 +109,12 @@ bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
 
 bool CIdleSummoner::ActMsg(CActMsg *msg) {
 	if (msg->_action == "Enable") {
-		if (!_fieldD4)
-			_fieldD4 = addTimer(15000, 15000);
+		if (!_timerId)
+			_timerId = addTimer(1, 15000, 15000);
 	} else if (msg->_action == "Disable") {
-		if (_fieldD4 > 0) {
-			stopAnimTimer(_fieldD4);
-			_fieldD4 = 0;
+		if (_timerId > 0) {
+			stopAnimTimer(_timerId);
+			_timerId = 0;
 		}
 	} else if (msg->_action == "DoorbotDismissed" || msg->_action == "BellbotDismissed") {
 		_ticks = getTicksCount();
diff --git a/engines/titanic/game/idle_summoner.h b/engines/titanic/game/idle_summoner.h
index 0066694..054ec6e 100644
--- a/engines/titanic/game/idle_summoner.h
+++ b/engines/titanic/game/idle_summoner.h
@@ -40,8 +40,8 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 	int _fieldD0;
-	int _fieldD4;
-	int _fieldD8;
+	int _timerId;
+	uint _oldNodesCtr;
 	uint _ticks;
 public:
 	CIdleSummoner();





More information about the Scummvm-git-logs mailing list