aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2010-04-19 09:40:20 +0000
committerPaul Gilbert2010-04-19 09:40:20 +0000
commitf1979f936fa30fba284a028a15518daf6c115c83 (patch)
tree81d2a9bde966c02a495e4184214ea03a96cee4ad /engines/lure
parent210bc3a3cef2e84c0d7bde5afa40a779136cf5d7 (diff)
downloadscummvm-rg350-f1979f936fa30fba284a028a15518daf6c115c83.tar.gz
scummvm-rg350-f1979f936fa30fba284a028a15518daf6c115c83.tar.bz2
scummvm-rg350-f1979f936fa30fba284a028a15518daf6c115c83.zip
Bugfix for correctly returning follower to player when they're blocked from acting
svn-id: r48709
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/hotspots.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 5a8a13e9ec..d34b9dfc16 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -4028,23 +4028,22 @@ void HotspotTickHandlers::npcRoomChange(Hotspot &h) {
if (h.exitCtr() >= 5) {
// Failed to exit room too many times
h.setExitCtr(0);
- if (h.currentActions().size() > 1) {
- // Pending items on stack
+
+ if (!h.currentActions().isEmpty()) {
if (h.startRoomNumber() != 0) {
- if (!h.currentActions().bottom().hasSupportData() ||
+ // If character isn't already returning to starting room, start them doing so
+ if (!h.currentActions().bottom().hasSupportData() ||
(h.currentActions().bottom().supportData().action() != RETURN)) {
- // Signal character to return
+ // Start follower returning
h.currentActions().clear();
h.currentActions().addFront(RETURN, h.startRoomNumber(), 0, 0);
}
}
- h.currentActions().top().setRoomNumber(h.roomNumber());
} else if ((h.blockedOffset() != 0) && (h.blockedOffset() != 0xffff)) {
// Only current action on stack - and there is a block handler
CharacterScheduleEntry *entry = res.charSchedules().getEntry(h.blockedOffset());
- h.currentActions().top().setSupportData(entry);
- h.currentActions().top().setRoomNumber(h.roomNumber());
+ h.currentActions().addFront(DISPATCH_ACTION, entry, h.roomNumber());
}
return;