diff options
author | Paul Gilbert | 2014-03-23 18:48:00 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-23 18:48:00 -0400 |
commit | 7f4dbf7d48b6db8d82d33b569c22f104fc153dd3 (patch) | |
tree | fcc7ec3bd57d6b3fb66154cdb3b2735a8ebddd69 /engines/mads/action.cpp | |
parent | a3952509a91b15ccc959e0dbddd12e1678e3814e (diff) | |
download | scummvm-rg350-7f4dbf7d48b6db8d82d33b569c22f104fc153dd3.tar.gz scummvm-rg350-7f4dbf7d48b6db8d82d33b569c22f104fc153dd3.tar.bz2 scummvm-rg350-7f4dbf7d48b6db8d82d33b569c22f104fc153dd3.zip |
MADS: Implemented more action handling methods
Diffstat (limited to 'engines/mads/action.cpp')
-rw-r--r-- | engines/mads/action.cpp | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index d52adbf0de..0c20fec918 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -36,8 +36,15 @@ MADSAction::MADSAction(MADSEngine *vm) : _vm(vm) { _statusTextIndex = -1; _selectedAction = 0; _inProgress = false; - _savedSelectedRow = false; - _savedLookFlag = false; + + _savedFields._actionMode = ABORTMODE_0; + _savedFields._actionMode2 = ABORTMODE_0; + _savedFields._selectedRow = -1; + _savedFields._hotspotId = 0; + _savedFields._v86F3A = 0; + _savedFields._v86F42 = 0; + _savedFields._articleNumber = 0; + _savedFields._lookFlag = false; } void MADSAction::clear() { @@ -293,37 +300,34 @@ void MADSAction::startAction() { else if (_v86F42 == 4) hotspotId = _savedFields._v86F3A; - if (hotspotId >= hotspots.size()) { + if (hotspotId >= (int)hotspots.size()) { DynamicHotspot &hs = dynHotspots[hotspotId - hotspots.size()]; if ((hs._feetPos.x == -1) || (hs._feetPos.x == -3)) { - if (_v86F4A && ((hs._feetPos.x == -3) || (_savedFields._selectedRow < 0))) { - _startWalkFlag = true; - - - scene._destPos = scene._customDest; - } - } else if ((hs._feetPos.x >= 0) && ((_savedFields._actionMode == ACTIONMODE_NONE) || - (hs._cursor < 2))) { + checkCustomDest(hs._feetPos.x); + } else if (hs._feetPos.x == 0) { + scene._destFacing = hs._facing; + } else if (_savedFields._actionMode == ACTIONMODE_NONE || hs._cursor >= CURSOR_WAIT) { _startWalkFlag = true; - scene._destPos.x = hs._feetPos.x; - scene._destPos.y = hs._feetPos.y; + scene._destPos = hs._feetPos; } + scene._destFacing = hs._facing; hotspotId = -1; } } - if (hotspotId >= 0) { + if (hotspotId >= 0 && hotspotId < (int)hotspots.size()) { Hotspot &hs = hotspots[hotspotId]; - if ((hs._feetPos.x == -1) || (hs._feetPos.x == -3)) { - if (_v86F4A && ((hs._feetPos.x == -3) || (_savedFields._selectedRow < 0))) { + + if (hs._feetPos.x == -1 || hs._feetPos.x != -3) { + checkCustomDest(hs._feetPos.x); + } else if (hs._feetPos.x >= 0) { + if (_savedFields._actionMode == ACTIONMODE_NONE || hs._cursor < CURSOR_WAIT) { _startWalkFlag = true; - scene._destPos = scene._customDest; + scene._destPos = hs._feetPos; } - } else if ((hs._feetPos.x >= 0) && ((_savedFields._actionMode == ACTIONMODE_NONE) || (hs._cursor < 2))) { - _startWalkFlag = true; - scene._destPos = hs._feetPos; } + scene._destFacing = hs._facing; } @@ -331,21 +335,18 @@ void MADSAction::startAction() { } void MADSAction::checkAction() { - /* - if (isAction(kVerbLookAt) || isAction(kVerbThrow)) + if (isAction(VERB_LOOK) || isAction(VERB_THROW)) _startWalkFlag = 0; - */ } bool MADSAction::isAction(int verbId, int objectNameId, int indirectObjectId) { - /* - if (_activeAction.verbId != verbId) + if (_activeAction._verbId != verbId) return false; - if ((objectNameId != 0) && (_activeAction.objectNameId != objectNameId)) + if ((objectNameId != 0) && (_activeAction._objectNameId != objectNameId)) return false; - if ((indirectObjectId != 0) && (_activeAction.indirectObjectId != indirectObjectId)) + if ((indirectObjectId != 0) && (_activeAction._indirectObjectId != indirectObjectId)) return false; - */ + return true; } |