From f1979f936fa30fba284a028a15518daf6c115c83 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 19 Apr 2010 09:40:20 +0000 Subject: Bugfix for correctly returning follower to player when they're blocked from acting svn-id: r48709 --- engines/lure/hotspots.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'engines/lure') 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; -- cgit v1.2.3