Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#8081 closed patch

Regression fix: The Dig invalid opcodes

Reported by: eriktorbjorn Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: The Dig

Description

This fixes a bug which would cause The Dig to crash the second time an actor spoke a particular line. This probably accounts for most or all of the recently introduced "invalid opcode" crashes.

The problem was that o6_talkActor() and o6_talkEgo() was corrupting the scripts by having strtok() write a 0 into them.

(The exact same code is added both to o6_talkActor() and o6_talkEgo(), so maybe it'd be more elegant to put it in translateText() instead...)

Ticket imported from: #618987. Ticket imported from: patches/186.

Attachments (1)

dig-crashfix.diff (1.4 KB ) - added by eriktorbjorn 22 years ago.
Patch against an October 4 CVS snapshot

Download all attachments as: .zip

Change History (5)

by eriktorbjorn, 22 years ago

Attachment: dig-crashfix.diff added

Patch against an October 4 CVS snapshot

comment:1 by eriktorbjorn, 22 years ago

It has been pointed out to me that there may still be problems with the way o6_talkActor() and o6_talkEgo() use strlen(), and the way translateText() uses strcpy(), but at least the patch fixes the most serious regression.

At least if it fails now it should always fail in the same way.

comment:2 by SF/ender, 22 years ago

Owner: set to SF/ender
Status: newclosed

comment:3 by SF/ender, 22 years ago

Thanks :)

Applied with some changes to use resStrLen instead of StrLen. Ideally memcpy should be used instead of strcpy, too.

comment:4 by digitall, 6 years ago

Component: Engine: SCUMM
Game: The Dig
Note: See TracTickets for help on using tickets.