diff options
author | Paul Gilbert | 2007-02-02 08:35:17 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-02-02 08:35:17 +0000 |
commit | f7958231be3561704fcd68dc9086c8b280b44b31 (patch) | |
tree | e4a63acffc754616f6055a56af3048c8bf35442e | |
parent | bb3e575e21a99c904f8909f75901894e4f2630dc (diff) | |
download | scummvm-rg350-f7958231be3561704fcd68dc9086c8b280b44b31.tar.gz scummvm-rg350-f7958231be3561704fcd68dc9086c8b280b44b31.tar.bz2 scummvm-rg350-f7958231be3561704fcd68dc9086c8b280b44b31.zip |
Bugfix to fix crash when Ratpouch chooses an in-room random destination
svn-id: r25333
-rw-r--r-- | engines/lure/hotspots.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 15cd7daf38..1477676d5f 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -1592,6 +1592,7 @@ void Hotspot::doBribe(HotspotData *hotspot) { if (sequenceOffset != 0) return; } + // TODO: talk_record_index showMessage(sequenceOffset); } @@ -2556,11 +2557,12 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { if ((fields.getField(37) == 0) && h.currentActions().isEmpty()) { - if (h.roomNumber() == h.currentActions().top().roomNumber()) { - // In room - set a random destination + if (h.roomNumber() == player->roomNumber()) { + // In same room as player - set a random destination h.setRandomDest(); } else { + // Character in different room than player if (h.hotspotId() == GOEWIN_ID) h.currentActions().addFront(DISPATCH_ACTION, player->roomNumber()); else { @@ -2568,7 +2570,7 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { RoomTranslationRecord *p = &roomTranslations[0]; while ((p->srcRoom != 0) && (p->srcRoom != player->roomNumber())) ++p; - h.currentActions().top().setRoomNumber( + h.currentActions().addFront(DISPATCH_ACTION, (p->srcRoom != 0) ? p->destRoom : player->roomNumber()); } } |