diff options
-rw-r--r-- | engines/lure/debugger.h | 2 | ||||
-rw-r--r-- | engines/lure/hotspots.cpp | 22 |
2 files changed, 20 insertions, 4 deletions
diff --git a/engines/lure/debugger.h b/engines/lure/debugger.h index 3936f9fb10..f447593fee 100644 --- a/engines/lure/debugger.h +++ b/engines/lure/debugger.h @@ -50,6 +50,8 @@ protected: bool cmd_debug(int argc, const char **argv); }; +extern const char *directionList[5]; + } // End of namespace Lure #endif diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 2d39b363f6..8fe8e74c76 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -204,6 +204,15 @@ Hotspot::Hotspot(): _pathFinder(NULL) { } Hotspot::~Hotspot() { + // WORKAROUND: If Blacksmith is being deactivated, make sure his animation is + // reset back to his standard movement set + if (_hotspotId == BLACKSMITH_ID) { + Resources &res = Resources::getReference(); + HotspotAnimData *tempAnim = res.animRecords()[BLACKSMITH_DEFAULT_ANIM_INDEX]; + assert(tempAnim); + _data->animRecordId = tempAnim->animRecordId; + } + if (_frames) delete _frames; } @@ -695,11 +704,16 @@ bool Hotspot::walkingStep() { int16 _xChange, _yChange; uint16 nextFrame; - frameSet->getFrame(frameNumber(), _xChange, _yChange, nextFrame); - setFrameNumber(nextFrame); - setPosition(x() + _xChange, y() + _yChange); + if (frameSet->getFrame(frameNumber(), _xChange, _yChange, nextFrame)) { + setFrameNumber(nextFrame); + setPosition(x() + _xChange, y() + _yChange); + + ++_pathFinder.stepCtr(); + } else { + warning("Hotspot %xh dir frame not found: currentFrame=%d, dir=%s", + _hotspotId, frameNumber(), directionList[(int) _pathFinder.top().direction()]); + } - ++_pathFinder.stepCtr(); return false; } |