aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-05 12:43:50 -0400
committerPaul Gilbert2014-04-05 12:43:50 -0400
commitebe4d369a54d852b7d789ac247a872799e68e495 (patch)
treed697765f08029deba38fc4bd3e1fffb8ce6b218c /engines
parentb778217d8eea64d385947a96a94cdea7c686c605 (diff)
downloadscummvm-rg350-ebe4d369a54d852b7d789ac247a872799e68e495.tar.gz
scummvm-rg350-ebe4d369a54d852b7d789ac247a872799e68e495.tar.bz2
scummvm-rg350-ebe4d369a54d852b7d789ac247a872799e68e495.zip
MADS: Fixes for actions triggering prematurely
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/action.cpp2
-rw-r--r--engines/mads/events.cpp6
-rw-r--r--engines/mads/game.cpp2
-rw-r--r--engines/mads/nebular/nebular_scenes1.cpp2
-rw-r--r--engines/mads/scene.cpp7
-rw-r--r--engines/mads/sequence.cpp10
-rw-r--r--engines/mads/sequence.h2
7 files changed, 17 insertions, 14 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp
index 005058078b..ccfd13be1d 100644
--- a/engines/mads/action.cpp
+++ b/engines/mads/action.cpp
@@ -320,7 +320,7 @@ void MADSAction::startAction() {
if (hotspotId >= 0 && hotspotId < (int)hotspots.size()) {
Hotspot &hs = hotspots[hotspotId];
- if (hs._feetPos.x == -1 || hs._feetPos.x != -3) {
+ if (hs._feetPos.x == -1 || hs._feetPos.x == -3) {
checkCustomDest(hs._feetPos.x);
} else if (hs._feetPos.x >= 0) {
if (_savedFields._commandSource == ACTIONMODE_NONE || hs._cursor < CURSOR_WAIT) {
diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp
index 29ea927bbc..244ae727e3 100644
--- a/engines/mads/events.cpp
+++ b/engines/mads/events.cpp
@@ -130,20 +130,20 @@ void EventsManager::pollEvents() {
_mouseClicked = true;
_mouseButtons = 1;
_mouseMoved = true;
- _anyStroke = true;
+ //_anyStroke = true;
return;
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
_mouseClicked = false;
_mouseReleased = true;
_mouseMoved = true;
- _anyStroke = true;
+ //_anyStroke = true;
return;
case Common::EVENT_MOUSEMOVE:
_mousePos = event.mouse;
_currentPos = event.mouse;
_mouseMoved = true;
- _anyStroke = true;
+ //_anyStroke = true;
break;
default:
break;
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 090ddd08ad..d0d3b272ad 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -59,7 +59,7 @@ Game::Game(MADSEngine *vm): _vm(vm), _surface(nullptr), _objects(vm),
_priorFrameTimer = 0;
_anyEmergency = false;
_triggerMode = KERNEL_TRIGGER_PARSER;
- _triggerSetupMode = KERNEL_TRIGGER_PARSER;
+ _triggerSetupMode = KERNEL_TRIGGER_DAEMON;
_winStatus = 0;
// Load the inventory object list
diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp
index cda8f8995c..c12e7217eb 100644
--- a/engines/mads/nebular/nebular_scenes1.cpp
+++ b/engines/mads/nebular/nebular_scenes1.cpp
@@ -432,6 +432,8 @@ void Scene103::actions() {
_vm->_dialogs->show(10321);
} else if (_action.isAction(VERB_LOOK, 409)) {
_vm->_dialogs->show(_game._objects.isInInventory(OBJ_TIMER_MODULE) ? 10324 : 10325);
+ } else {
+ return;
}
_action._inProgress = false;
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 64260a69dc..02877aac9c 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -313,9 +313,10 @@ void Scene::doFrame() {
if (!_vm->_game->_fx)
_frameStartTime = _vm->_events->getFrameCounter();
- if ((_action._inProgress && !player._moving && !player._needToWalk &&
- player._turnToFacing == player._facing) ||
- (_vm->_game->_trigger && _vm->_game->_triggerMode == KERNEL_TRIGGER_PARSER)) {
+ // Handle parser actions as well as game triggers
+ if ((_action._inProgress && !player._moving && !player._needToWalk &&
+ (player._facing == player._turnToFacing) && !_vm->_game->_trigger) ||
+ (_vm->_game->_trigger && (_vm->_game->_triggerMode == KERNEL_TRIGGER_PARSER))) {
doAction();
}
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index 01ca69615f..5150b75c25 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -47,7 +47,7 @@ SequenceEntry::SequenceEntry() {
_field22 = 0;
_triggerCountdown = 0;
_doneFlag = 0;
- _abortMode = KERNEL_TRIGGER_PARSER;
+ _triggerMode = KERNEL_TRIGGER_DAEMON;
_numTicks = 0;
_extraTicks = 0;
_timeout = 0;
@@ -135,7 +135,7 @@ int SequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int tri
_entries[seqIndex]._flags = 0;
_entries[seqIndex]._dynamicHotspotIndex = -1;
_entries[seqIndex]._entries._count = 0;
- _entries[seqIndex]._abortMode = _vm->_game->_triggerSetupMode;
+ _entries[seqIndex]._triggerMode = _vm->_game->_triggerSetupMode;
_entries[seqIndex]._actionNouns = _vm->_game->_scene._action._activeAction;
@@ -160,7 +160,7 @@ int SequenceList::addTimer(int time, int abortVal) {
se._triggerCountdown = true;
se._doneFlag = false;
se._entries._count = 0;
- se._abortMode = _vm->_game->_triggerSetupMode;
+ se._triggerMode = _vm->_game->_triggerSetupMode;
se._actionNouns = _vm->_game->_scene._action._activeAction;
addSubEntry(seqIndex, SM_0, 0, abortVal);
@@ -328,9 +328,9 @@ bool SequenceList::loadSprites(int seqIndex) {
if (idx >= 0) {
_vm->_game->_trigger = seqEntry._entries._abortVal[idx];
- _vm->_game->_triggerMode = seqEntry._abortMode;
+ _vm->_game->_triggerMode = seqEntry._triggerMode;
- if (seqEntry._abortMode == KERNEL_TRIGGER_DAEMON)
+ if (seqEntry._triggerMode == KERNEL_TRIGGER_DAEMON)
scene._action._activeAction = seqEntry._actionNouns;
}
diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h
index 5dfdbce70e..8db06d5985 100644
--- a/engines/mads/sequence.h
+++ b/engines/mads/sequence.h
@@ -74,7 +74,7 @@ struct SequenceEntry {
int _triggerCountdown;
bool _doneFlag;
SequenceSubEntries _entries;
- TriggerMode _abortMode;
+ TriggerMode _triggerMode;
ActionDetails _actionNouns;
int _numTicks;