#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)
Change History (5)
by , 22 years ago
Attachment: | dig-crashfix.diff added |
---|
comment:1 by , 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 , 22 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:3 by , 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 , 6 years ago
Component: | → Engine: SCUMM |
---|---|
Game: | → The Dig |
Patch against an October 4 CVS snapshot