[Scummvm-tracker] [ScummVM] #10773: QFG4 floppy: Crash when asking Cranium for potions

sluicebox trac at scummvm.org
Wed Nov 28 04:54:56 CET 2018


#10773: QFG4 floppy: Crash when asking Cranium for potions
--------------------------------+-------------------------
  Reporter:  Vhati              |      Owner:  (none)
      Type:  defect             |     Status:  new
  Priority:  high               |  Component:  Engine: SCI
Resolution:                     |   Keywords:  SCI32
      Game:  Quest for Glory 4  |
--------------------------------+-------------------------

Comment (by sluicebox):

 Is making copy protection not crash considered cracking? =)

 I took a look, and thanks to your great notes, I came up with a patch. Can
 you please test this?
 https://github.com/sluicebox/scummvm/commit/e1aa5b3be598b24be3f8a70d1abab12636ecf656

 You're right that the difference in craniumTalker:dispose shows the
 problem. Weird that they they fixed it in the CD version since it doesn't
 run the copy protection script. I don't see any other scripts that depend
 on this. I used the debugger to get the CD version to run the copy
 protection and it doesn't crash, so their fix works.

 The bug is that delayMsg:changeState(0) calls craniumTalker:showAgain even
 though it's already been disposed. This patch re-initializes craniumTalker
 so that showAgain is safe to call. craniumTalker is re-initialized as you
 navigate between conversation sections so that's normal.

 delayMsg:changeState(0):


 {{{
 (if ((ScriptID 88 0) init: local4 show: dispose:) ; protection:show
 returns 1 or 0
         (= register 1)
 else
         (= register 0)
 )
 ((craniumTeller talker?) showAgain:) ; showAgain crashes
 }}}


 becomes:


 {{{
 (= register ((ScriptID 88 0) init: local4 show: dispose:))
 ((craniumTeller talker?) init: showAgain:)
 }}}

--
Ticket URL: <https://bugs.scummvm.org/ticket/10773#comment:10>
ScummVM <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list