From 11e29ca4d4ba5cc9f9ec82ab61be7e6d9ede7ff0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Dec 2007 04:52:01 +0000 Subject: Bugfix to make any animation the player is doing uninterruptable svn-id: r29690 --- engines/lure/hotspots.cpp | 22 ++++++++++------------ engines/lure/hotspots.h | 2 +- engines/lure/scripts.cpp | 3 +++ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 32b6f8d581..9d87744610 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -78,12 +78,6 @@ Hotspot::Hotspot(HotspotData *res): _pathFinder(this) { _tickHandler = HotspotTickHandlers::getHandler(_data->tickProcId); _nameBuffer[0] = '\0'; - if (_hotspotId < FIRST_NONCHARACTER_ID) { - // Default characters to facing upwards until they start moving - _direction = UP; - setFrameNumber(_anim->upFrame); - } - _skipFlag = false; _charRectY = 0; _voiceCtr = 0; @@ -515,7 +509,6 @@ void Hotspot::endAction() { _voiceCtr = 0; setActionCtr(0); if (_hotspotId == PLAYER_ID) - //Room::getReference().setCursorState(CS_NONE); **DEBUG** room.setCursorState((CursorState) ((int) room.cursorState() & 2)); if (_currentActions.top().hasSupportData()) { @@ -1247,13 +1240,17 @@ void Hotspot::doAction(Action action, HotspotData *hotspot) { } void Hotspot::doNothing(HotspotData *hotspot) { - _currentActions.pop(); if (!_currentActions.isEmpty()) { - setBlockedFlag(false); - currentActions().top().setAction(DISPATCH_ACTION); - } else if (hotspotId() == PLAYER_ID) { - Room::getReference().setCursorState(CS_NONE); + _currentActions.pop(); + if (!_currentActions.isEmpty()) { + setBlockedFlag(false); + currentActions().top().setAction(DISPATCH_ACTION); + return; + } } + + if (hotspotId() == PLAYER_ID) + Room::getReference().setCursorState(CS_NONE); } void Hotspot::doGet(HotspotData *hotspot) { @@ -2825,6 +2822,7 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) { // Make sure there is no longer any destination h.setDestHotspot(0); h.updateMovement2(CHARMODE_IDLE); + h.doNothing(NULL); strcpy(room.statusLine(), ""); break; diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index a02df45313..4ff924f811 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -308,7 +308,6 @@ private: void resetDirection(); // Action set - void doNothing(HotspotData *hotspot); void doGet(HotspotData *hotspot); void doOperate(HotspotData *hotspot); void doOpen(HotspotData *hotspot); @@ -540,6 +539,7 @@ public: void setVoiceCtr(uint8 v) { _voiceCtr = v; } // Miscellaneous + void doNothing(HotspotData *hotspot); void converse(uint16 destCharacterId, uint16 messageId, bool srcStandStill = false, bool destStandStill = false); void showMessage(uint16 messageId, uint16 destCharacterId = NOONE_ID); diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 49dfb76433..4de261d998 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -340,6 +340,9 @@ void Script::setBlockingHotspotScript(uint16 charId, uint16 scriptIndex, uint16 Resources &r = Resources::getReference(); uint16 offset = r.getHotspotScript(scriptIndex); + if (charId == PLAYER_ID) + Room::getReference().setCursorState(CS_SEQUENCE); + Hotspot *hs = r.getActiveHotspot(charId); hs->setHotspotScript(offset); hs->currentActions().top().setAction(EXEC_HOTSPOT_SCRIPT); -- cgit v1.2.3