Opened 6 years ago

Closed 3 years ago

#6802 closed defect (fixed)

FREDDI2: assert() error

Reported by: BenCastricum Owned by: BenCastricum
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Freddi Fish 2

Description

When you give a purple sea urchin to Barnacle Bob without talking to him first I get an assert error (see attached screenshot). This is with the dutch version on Windows 7, I compiled it myself with mscv10.

ScummVM 1.8.0git (Feb 4 2015 21:03:07) Features compiled in: Vorbis FLAC MP3 RGB zLib Theora FreeType2 JPEG PNG

Ticket imported from: bugs/6802.

Attachments (3)

freddi2-assert.png (13.5 KB ) - added by BenCastricum 6 years ago.
freddi2-win-nl-freddi2.sg1 (46.0 KB ) - added by BenCastricum 6 years ago.
freddi2-win-freddi2.sg4 (46.9 KB ) - added by eriktorbjorn 6 years ago.

Download all attachments as: .zip

Change History (10)

by BenCastricum, 6 years ago

Attachment: freddi2-assert.png added

by BenCastricum, 6 years ago

Attachment: freddi2-win-nl-freddi2.sg1 added

comment:1 by BenCastricum, 6 years ago

Saved game right before the assert(). Just give the urchin to Bob. You can skip the dialog and trigger it immediately.

I also checked if the original game has a problem with this too (using a vmware emulated windows XP) situation too, but it plays fine.

comment:2 by fuzzie, 6 years ago

I can reproduce with freddi2-nl on master:

scummvm: engines/scumm/object.cpp:113: void Scumm::ScummEngine::setOwnerOf(int, int): Assertion `obj > 0' failed.

by eriktorbjorn, 6 years ago

Attachment: freddi2-win-freddi2.sg4 added

comment:3 by eriktorbjorn, 6 years ago

I can reproduce with my English version as well, but only (?) if I carry just one sea urchin. The first time I tried it, I had four and everything worked as expected. I'm attaching a savegame from right outside the emporium.

comment:4 by fuzzie, 6 years ago

Bug is in room 39. Problem is script 18, in the localvar2==78 case; this only sets the obj id if var198 is non-zero, but in the asserting case, it is obj 0. That means two setOwnerOf calls are made with obj 0.

Adding a workaround to just ignore the obj==0 calls in this circumstance seems like it would work fine (there's already one in the code here), but I'm not sure what to check for this (room ID and var198 being zero?). The correct setOwnerOf calls are made afterwards, so this seems to work just fine.

comment:5 by BenCastricum, 4 years ago

This seems to work for me if I insert it at line 113 of object.cpp. But it's a different script number than you have found. Which version of FF2 uses script 18? The ones I tried (mostly from Steam) all use 10. ~~~ if (_game.id == GID_HEGAME && obj == 0 && vm.slot[_currentScript].number == 10) return; ~~~

comment:6 by BenCastricum, 4 years ago

The above patch went into master, I playtested it again and it solves my issue. If you ask me this bug can be closed.

Last edited 3 years ago by BenCastricum (previous) (diff)

comment:7 by BenCastricum, 3 years ago

Owner: set to BenCastricum
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.