Opened 4 years ago

Closed 23 months 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 4 years ago.
freddi2-win-nl-freddi2.sg1 (46.0 KB) - added by BenCastricum 4 years ago.
freddi2-win-freddi2.sg4 (46.9 KB) - added by eriktorbjorn 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by BenCastricum

Attachment: freddi2-assert.png added

Changed 4 years ago by BenCastricum

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

comment:1 Changed 4 years ago by BenCastricum

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 Changed 4 years ago by fuzzie

I can reproduce with freddi2-nl on master:

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

Changed 4 years ago by eriktorbjorn

Attachment: freddi2-win-freddi2.sg4 added

comment:3 Changed 4 years ago by eriktorbjorn

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 Changed 4 years ago by fuzzie

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 Changed 3 years ago by BenCastricum

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 Changed 3 years ago by BenCastricum

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 23 months ago by BenCastricum (previous) (diff)

comment:7 Changed 23 months ago by BenCastricum

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