diff options
author | Paul Gilbert | 2017-07-22 21:56:46 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-07-22 21:56:46 -0400 |
commit | 96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60 (patch) | |
tree | 3738db8bee1a219f0f8ce98e4958ace1c2a23c7d /engines/titanic/game/idle_summoner.cpp | |
parent | 371a594b8d2f28535c76222b57430e0467583ea0 (diff) | |
download | scummvm-rg350-96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60.tar.gz scummvm-rg350-96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60.tar.bz2 scummvm-rg350-96a1b7070088ce2a9fdcb85f124fd0a2d7ef8d60.zip |
TITANIC: Fixes for CIdleSummoner to summon Bellbot or Doorbot
Diffstat (limited to 'engines/titanic/game/idle_summoner.cpp')
-rw-r--r-- | engines/titanic/game/idle_summoner.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/engines/titanic/game/idle_summoner.cpp b/engines/titanic/game/idle_summoner.cpp index 0e3604a4a9..ed0a3d0665 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(); |