[Scummvm-tracker] [ScummVM] #10837: QFG4: Crash casting Trigger on squid monolith after using grapnel
Vhati
trac at scummvm.org
Sun Dec 16 08:12:06 CET 2018
#10837: QFG4: Crash casting Trigger on squid monolith after using grapnel
--------------------------------+----------------------------
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):
I had to decompile this first quote by hand because SCI Companion got
confused.
\\
\\
script 11 - castTriggerScript::changeState(2)
{{{
(triggerEffect
x: g441_myX
y: g442_myY
setScaler: g0_hero
cycleSpeed: 0
setPri: 180
init:
setCycle: Fwd
)
#...
}}}
The Trigger spell is calling triggerEffect::setScaler(g0_hero).
\\
\\
script 64998 - Prop::setScaler()
{{{
(method (setScaler param1)
(if scaler (scaler dispose:) (= scaler 0))
(cond
((or (not argc) (not param1)) (return))
((param1 isKindOf: Scaler)
(= scaler
(if (& (param1 -info-?) $8000)
(param1 new:)
else
param1
)
)
(= scaleSignal (| scaleSignal $0001))
(= scaleSignal (& scaleSignal $fffd))
(scaler init: self &rest)
)
# An arg was given, hero, which is not itself a Scaler. We land here.
(else
(= scaler ((param1 scaler?) new:))
(= scaleSignal (param1 scaleSignal?))
(= maxScale (param1 maxScale?))
(scaler client: self doit:)
)
)
)
}}}
There's an attempt to clone hero's scaler by calling new() on it.
Problem: hero's scaler is null.
\\
\\
script 800 - sUseTheGrapnel::changeState(5)
{{{
(5
(g0_hero
view: 7
setLoop: 0 1
setCel: 0
setScale:
cycleSpeed: 8
setCycle: End self
)
)
}}}
hero::setScale() is given no arg.
\\
\\
script 64998 - Prop::setScale()
{{{
(method (setScale param1)
(if scaler (scaler dispose:) (= scaler 0))
(if (not argc)
(super setScale:)
else
(super setScale: param1)
)
)
}}}
The superclass method, View::setScale(), without args, just twiddles some
bit flags on the "scaleSignal" property.
Using the grapnel nulls out hero's scaler.
The Trigger spell can't handle the null.
\\
\\
Throughout the game, "setScale: [blank]" and "setScale: 0" are frequent,
so this is a problem with Trigger.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10837#comment:3>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list