Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3957 closed defect (fixed)

DRASCULA: Crash when talking to the piano player

Reported by: SF/ifo Owned by: bluegr
Priority: normal Component: Engine: Drascula
Version: Keywords:
Cc: Game: Drascula


After Drascula kidnapping the girl (right in the beginning of the game) talk to the piano player and say "Ein Vampir hat das Maedel von 506 entfuehrt!" (first choice). After the sentence "Du musst mir helfen !" / "You have to help me out!" the game crashes with a segmentation fault.

This crash happens reproducibly with the German version of the game, downloaded from the ScummVM site, both with version 0.12.0 and the current trunk on 64 bit Linux. Other combinations were not tested - a savegame is attached.

Ticket imported from: #2102657. Ticket imported from: bugs/3957.

Attachments (2)

drascula-de01 (69 bytes ) - added by SF/ifo 13 years ago.
word-wrapping.diff (2.9 KB ) - added by eriktorbjorn 13 years ago.
Patch against current SVN

Download all attachments as: .zip

Change History (13)

by SF/ifo, 13 years ago

Attachment: drascula-de01 added


comment:1 by SF/ifo, 13 years ago

Summary: Crash when talking to the piano playerDRASCULA: Crash when talking to the piano player

comment:2 by bluegr, 13 years ago

It crashes in DrasculaEngine::centerText(), line 336 (strrchr returns 0), when it's trying to print "TUT MIR LEID. DIE KLAVIERSPIELERGEWERKSCHAFT ERLAUBT ES MIR NICHT, MaeDCHEN AUS DEN KLAUEN VON VAMPIREN ZU BEFREIEN"

centerText() is a big mess :/

by eriktorbjorn, 13 years ago

Attachment: word-wrapping.diff added

Patch against current SVN

comment:3 by eriktorbjorn, 13 years ago

I've been trying to clean up the word-wrapping a bit, but it's like putting lipstick on a pig. The problem seems to be that there is a word, "KLAVIERSPIELERGEWERKSCHAFT", which by itself is too long to fit on one line.

I've attached my cleanup/workaround patch, which prevents the crash but the text is drawn partly outside the screen. I don't want to commit it without discussion, because the word-wrapping itself is so ugly that I have a feeling it ought to be rewritten. File Added: word-wrapping.diff

comment:4 by eriktorbjorn, 13 years ago

I guess the patch I attached is already a bit out of date. Assigning to thebluegr, since he's done much of the work on the game engine, at least recently.

comment:5 by eriktorbjorn, 13 years ago

Owner: set to bluegr

comment:6 by bluegr, 13 years ago

I'm sorry eriktorbjorn, I didn't see your patch before I tried to make some sense of the code in centerText()

I'll check it tomorrow

comment:7 by bluegr, 13 years ago

Fixed in the latest SVN version

comment:8 by bluegr, 13 years ago

Resolution: fixed
Status: newclosed

comment:9 by eriktorbjorn, 13 years ago

Could this be applied to the 0.12 branch as well? I wouldn't be surprised if there's a 0.12.1 release at some point.

comment:10 by eriktorbjorn, 13 years ago

There seems to be a slight difference in behaviour between the old and the new function: One-line texts drawn when the mouse passes over an object are now partially obscured by the mouse cursor.

comment:11 by bluegr, 13 years ago

Indeed, text should be displayed correctly now. Changes backported to 0.12.0 branch too

Note: See TracTickets for help on using tickets.