Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1636 closed defect (fixed)

MIVGA: Mug o' grog

Reported by: SF/chrilith Owned by: eriktorbjorn
Priority: normal Component: Engine: SCUMM
Keywords: script Cc:
Game: Monkey Island 1

Description

Someone report me that there is a problem in Monkey Island VGA after using the mug with the barrel in the scummbar.

Mug object names :

- mug o' grog - melting mug - mug near death - pewter wad

then crash with error : ERROR: (35: 65: 0xCE): Invalid actor 117 in o5_putActorInRoom

Seems to occured only where you are out of the scummbar (mug simply disapear if you stay in).

Tested on PalmOS with snapshot 2004-04-20 and 2004- 05-25 and Windows snapshot 2004-05-23

Savegame attached.

Ticket imported from: #960674. Ticket imported from: bugs/1636.

Attachments (2)

monkeyvga.s02 (59.0 KB ) - added by SF/chrilith 16 years ago.
object.diff (711 bytes ) - added by eriktorbjorn 16 years ago.
Patch against a May 27 CVS snapshot

Download all attachments as: .zip

Change History (10)

by SF/chrilith, 16 years ago

Attachment: monkeyvga.s02 added

comment:1 by eriktorbjorn, 16 years ago

Hmm... I can understand part of what's happening. Here's the end of script-65:

[00A7] (D4) setObjectName(Local[0],"pewter wad") [00B5] (2E) delay(300) [00B9] (A9) setOwnerOf(Local[0],0) [00BD] (A9) setOwnerOf(Local[0],15) [00C1] (D4) setObjectName(Local[0],"mug") [00C8] (0C) unlockScript(66) [00CB] (A0) stopObjectCode() END

However, here's the end of the debug output:

getResourceAddress(Script,65) == 01653244 Script 65, offset 0xc8: [D4] o5_setObjectName() readvar(16384) Can't find OBCD to rename object 375 Script 65, offset 0xcb: [6D] o5_putActorInRoom() readvar(103) (41:65:0xCE): Invalid actor 117 in o5_putActorInRoom

There shouldn't be any putActorInRoom opcode after setObjectName. However, since getOBCDFromObject() failed we won't ever reach loadPtrToResource(), so the script pointer won't be properly updated.

Notice how putActorInRoom is opcode 0x6D. That's not an opcode in this case - it's the "m" in "mug". Ouch!

comment:2 by eriktorbjorn, 16 years ago

Fingolfin, what's your take on this? It appears to be one of the regressions you warned might happen when you changed the object naming code, and obviously we'll have to make sure the script pointer is correctly updated like it used to be.

However, I can't even see why we call getOBCDFromObject() to begin with. It doesn't appear to actually do anything other than returning or, in this case, failing to return a pointer, and as far as I can see we don't even use it afterwards. Could that part of the code simply be removed, or am I missing something obvious?

comment:3 by eriktorbjorn, 16 years ago

Owner: set to fingolfin

by eriktorbjorn, 16 years ago

Attachment: object.diff added

Patch against a May 27 CVS snapshot

comment:4 by eriktorbjorn, 16 years ago

Just to clarify, this is what the patch would look like.

comment:5 by Kirben, 16 years ago

Summary: Mug o' grogMIVGA: Mug o' grog

comment:6 by fingolfin, 16 years ago

Looks fine to me. Feel free and apply it, erik (and then take over & close this bug report :-)

comment:7 by eriktorbjorn, 16 years ago

Applied.

comment:8 by eriktorbjorn, 16 years ago

Owner: changed from fingolfin to eriktorbjorn
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.