MADS: Fixes for actions triggering prematurely

This commit is contained in:
Paul Gilbert 2014-04-05 12:43:50 -04:00
parent b778217d8e
commit ebe4d369a5
7 changed files with 17 additions and 14 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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();
}

View File

@ -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;
}

View File

@ -74,7 +74,7 @@ struct SequenceEntry {
int _triggerCountdown;
bool _doneFlag;
SequenceSubEntries _entries;
TriggerMode _abortMode;
TriggerMode _triggerMode;
ActionDetails _actionNouns;
int _numTicks;