From 29a8cb651a09e6d42e9bf123e3866d20373dc316 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 5 Apr 2010 06:07:14 +0000 Subject: Bugfix for correctly getting a follower to return to player when blocked from exiting a room 5 times svn-id: r48533 --- engines/lure/hotspots.cpp | 6 ++++-- engines/lure/res_struct.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/lure') diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index a40eaaddfb..ca89af2af9 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -4022,8 +4022,10 @@ void HotspotTickHandlers::npcRoomChange(Hotspot &h) { if (h.currentActions().size() > 1) { // Pending items on stack if (h.startRoomNumber() != 0) { - if (h.currentActions().top().supportData().id() != RETURN_SUPPORT_ID) { - h.currentActions().top().supportData().setDetails(RETURN, 0); + if (!h.currentActions().bottom().hasSupportData() || (h.currentActions().bottom().action() != RETURN)) { + // Signal character to return + h.currentActions().clear(); + h.currentActions().addFront(RETURN, h.startRoomNumber(), 0, 0); } } h.currentActions().top().setRoomNumber(h.roomNumber()); diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 6671ab118d..afb8ee9153 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -467,6 +467,11 @@ public: bool isEmpty() { return _actions.begin() == _actions.end(); } void clear() { _actions.clear(); } CurrentActionEntry &top() { return **_actions.begin(); } + CurrentActionEntry &bottom() { + ActionsList::iterator i = _actions.end(); + --i; + return **i; + } CurrentAction action() { return isEmpty() ? NO_ACTION : top().action(); } void pop() { _actions.erase(_actions.begin()); } int size() { return _actions.size(); } -- cgit v1.2.3