#8143 closed patch
FOA: Possible fixes for bug #649540
Reported by: | eriktorbjorn | Owned by: | SF/ender |
---|---|---|---|
Priority: | normal | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: | Indiana Jones 4 |
Description
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:
[0057] (9E) walkActorTo(Var[1],610,115) [005E] (80) breakHere() [005F] (80) breakHere() [0060] (80) breakHere() [0061] (80) breakHere() [0062] (80) breakHere() [0063] (80) breakHere() [0064] (9E) walkActorTo(Var[182],650,120) [006B] (12) panCameraTo(600) [006E] (AE) WaitForActor(Var[182]) [0072] (AE) WaitForActor(Var[1]) [0076] (11) animateCostume(2,244) [0079] (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.
Attachments (3)
Change History (8)
by , 22 years ago
Attachment: | parrot-fix1.diff added |
---|
comment:1 by , 22 years ago
Is there any reason why all three couldn't be implemented? It might sound silly, but all three sound like good common- sense checks that the script engine should be making as a matter of course. Unless, of course, the game scripts exploit quirks in the opcodes to achieve certain effects.
comment:2 by , 22 years ago
I tested the third solution with indy4 and sam'n'max and din't find any noticable regression...
comment:4 by , 22 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:5 by , 6 years ago
Component: | → Engine: SCUMM |
---|---|
Game: | → Indiana Jones 4 |
Patch implementing method 1 fix