[Scummvm-tracker] [ScummVM] #10835: QFG4: Mage stuck unable to cast spells in endgame crystal room

Vhati trac at scummvm.org
Thu Dec 13 20:00:02 CET 2018


#10835: QFG4: Mage stuck unable to cast spells in endgame crystal room
--------------------------------+----------------------------
  Reporter:  Vhati              |      Owner:  (none)
      Type:  defect             |     Status:  new
  Priority:  high               |  Component:  Engine: SCI
Resolution:                     |   Keywords:  SCI32 original
      Game:  Quest for Glory 4  |
--------------------------------+----------------------------

Comment (by Vhati):

 SCI Companion got confused, so I decompiled project by hand.
 I might've made mistakes. Raw disasm from ScummVM is attached.
 \\
 \\
 script 32 - project::changeState()
 {{{
 (switch (= state param1))
         (0
                 (proc0_12 g70 (- g71 10))
                 (g1_Glory handsOff:)
                 (proc0_10 g0_hero g441 g442 self)
         )
         (1
                 (if (== register 36)
                         (= register 37)
                 )
                 (= loc3 (g0_hero heading:))
                 (= loc0 (g0_hero loop:))
                 (g0_hero setMotion: 0)

                 (g0_hero
                         view:
                                 (cond
                                         ((< register 75) 9)
                                         ((and (> (hero view:) 17) (< (hero
 view:) 21)) 18)
                                         else 14
                                 )
                         loop:
                                 (cond
                                         ((and (<= 0 loc3) (<= loc3 85)) (=
 loc2 2))
                                         ((and (<= 86 loc3) (<= loc3 180))
 (= loc2 0))
                                         ((and (<= 181 loc3) (<= loc3 274))
 (= loc2 1))
                                         (else (= loc2 3))
                                 )
                         setCel: 0
                 )

                 (cond
                         ((< register 75) (g0_hero setCycle: CT 4 1 self))
                         ((and (> (g0_hero view:) 17) (< (g0_hero view:)
 21)) (g0_hero setCycle: CT 2 1 self))
                         (else (g0_hero setCycle: End self))
                 )
         )
         (2
                 (if (proc64999_5 register 21 37)
                         (if [g247 10]
                                 (g0_hero
                                         useSkill: 10 25
                                         useSkill: 0 3
                                         useSkill: 2 5
                                 )
                         )
                         (g0_hero useStamina: 2)
                         (= temp0 (Random 0 (>> (+ (- 400 [g247 10]) 4)
 2)))
                         (= g441 (+ g441 (if (Random 0 1) (- 0 temp0) else
 temp0)))
                 )
                 ((ProjObj new:) fixPriority: 1 type: register init:)
                 (switch register
                         (86
                                 (spellSoundFX number: 933 play:)
                         )
                         (88
                                 (spellSoundFX number: 938 play:)
                         )
                         (93
                                 (spellSoundFX number: 974 play:)
                         )
                         (79
                                 (spellSoundFX number: 983 play:)
                         )
                         (else
                                 (spellSoundFX number: 916 play:)
                         )
                 )
                 (if
                         (or
                                 (and (> (g0_hero view:) 17) (< (g0_hero
 view:) 21))
                                 (< register 75)
                         )
                         (g0_hero setCycle End self)
                 else
                         (g0_hero setCycle Beg self)
                 )
         )
         (3
                 (if (not (and (> (g0_hero view:) 17) (< (g0_hero view:)
 21)))
                         (g0_hero normalize: 0)
                 else
                         (g0_hero
                                 view: 20
                                 loop: (loc11 at: (g0_hero loop:))
                                 cel: (if (< (loc11 at: (g0_hero loop:)) 6)
 4 else 5)
                         )
                 )
                 (= cycles 2)
         )
         (4
                 (if (not (proc0_4 9))
                         (g1_Glory handsOn:)
                 )
                 (self dispose:)
         )
 )
 }}}
 \\
 \\
 Stepping through at regular and max speed then diffing the logs showed
 state 2 is playing out exactly the same, regardless of speed. Except at
 max, it can reach state 3. At slower speeds, it cannot.

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


More information about the Scummvm-tracker mailing list