FOA: Possible fixes for bug #649540
|Reported by:||eriktorbjorn||Owned by:||SF/ender|
|Game:||Indiana Jones 4|
I've been looking at bug #649540 ("INDY4 CD: Tikal bird..."), and I know what's causing it.
When you talk to the parrot, the script instructs Sohia to walk to a certain spot, waits for her to stop moving, and then tells her to turn and face left. This is what the script looks like:
 (9E) walkActorTo(Var,610,115) [005E] (80) breakHere() [005F] (80) breakHere()  (80) breakHere()  (80) breakHere()  (80) breakHere()  (80) breakHere()  (9E) walkActorTo(Var,650,120) [006B] (12) panCameraTo(600) [006E] (AE) WaitForActor(Var)  (AE) WaitForActor(Var)  (11) animateCostume(2,244)  (11) animateCostume(1,244) [007C] (AE) WaitForCamera()
The turnToDirection() function will set Sophia's 'moving' variable to indicate she's turning, and then trust walkActors() to do the actual turning. However, only actors that are actually in the room are walked, and in this case Sophia isn't. So the next time you talk to the parrot, the WaitForActor opcode will never terminate.
There are several possible ways of fixing this, and I'm going to need some help deciding which one is the most appropriate.
1. Make animateActor() a no-op if the actor isn't present. 2. Make walkActors() mark actors who aren't present as not moving. 3. Make WaitForActor terminate if the actor isn't present.
1 is perhaps the most direct approach, but it's probably worth noting that 3 is most similar to already existing code -- the "wait until actor drawn" case in script_v2.cpp already checks if the actor is present.
I haven't done any regression testing of either of these, and in the case of 3 I haven't even checked if o6_wait() is working, since FOA uses o5_wait().
All patches are made against the same December 6 CVS snapshot.
Ticket imported from: #650135. Ticket imported from: patches/248.