aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2010-04-05 06:07:14 +0000
committerPaul Gilbert2010-04-05 06:07:14 +0000
commit29a8cb651a09e6d42e9bf123e3866d20373dc316 (patch)
tree35194c8903b510ecd0f5c71800594f0cb23c35cc /engines/lure
parent7555461ac39fb96bca690f6492cc3499674702c0 (diff)
downloadscummvm-rg350-29a8cb651a09e6d42e9bf123e3866d20373dc316.tar.gz
scummvm-rg350-29a8cb651a09e6d42e9bf123e3866d20373dc316.tar.bz2
scummvm-rg350-29a8cb651a09e6d42e9bf123e3866d20373dc316.zip
Bugfix for correctly getting a follower to return to player when blocked from exiting a room 5 times
svn-id: r48533
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/hotspots.cpp6
-rw-r--r--engines/lure/res_struct.h5
2 files changed, 9 insertions, 2 deletions
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(); }