SAGA: Fix potential crash when talking to Sist (bug #10365)
When Rif puts on the rat disguise, he is swapped out for a different actor. When he takes off the disguise, after reaching Sist's office, the old actor is swapped back in again. At that point, original Rif's actor will have a _lastZone pointer which not only is for the wrong room, it was deleted when Rif in disguise left the room. To fix this, we also swap the actors's _lastZone pointers.
This commit is contained in:
parent
90f6d119cf
commit
66400e7422
1 changed files with 1 additions and 0 deletions
|
@ -735,6 +735,7 @@ void Script::sfSwapActors(SCRIPTFUNC_PARAMS) {
|
||||||
ActorData *actor2 = _vm->_actor->getActor(actorId2);
|
ActorData *actor2 = _vm->_actor->getActor(actorId2);
|
||||||
|
|
||||||
SWAP(actor1->_location, actor2->_location);
|
SWAP(actor1->_location, actor2->_location);
|
||||||
|
SWAP(actor1->_lastZone, actor2->_lastZone);
|
||||||
|
|
||||||
if (actor1->_flags & kProtagonist) {
|
if (actor1->_flags & kProtagonist) {
|
||||||
actor1->_flags &= ~kProtagonist;
|
actor1->_flags &= ~kProtagonist;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue