[Scummvm-tracker] [ScummVM] #10615: QFG4: Tentacle doesn't retract after crossing pit at start of game
ScummVM
trac at scummvm.org
Wed Dec 26 02:26:11 CET 2018
#10615: QFG4: Tentacle doesn't retract after crossing pit at start of game
--------------------------------+-------------------------
Reporter: 2Mourty | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCI
Resolution: | Keywords: Tentacle
Game: Quest for Glory 4 |
--------------------------------+-------------------------
Comment (by Vhati):
The tentacle is given a RandCycle, which gets stuck.
\\
\\
script 710 - sTentacleDeath::changeState(3)
{{{
(tentacle setCycle: RandCycle tentacle)
}}}
It's not that RandCycle itself is broken because the torch flickering
works.
\\
\\
script 710 - rm710::init()
{{{
(torchEff init: setScaler: global0 setCycle: RandCycle)
}}}
One obvious difference: the torch cycler has no arg.
\\
\\
setCycle() constructs a new cycler and calls the cycler's init(),
prepending self to the args.
\\
\\
script 64998 - Prop::setCycle()
{{{
(method (setCycle param1)
(if cycler (cycler dispose:))
(if param1
(= cycler
(if (& (param1 -info-?) $8000)
(param1 new:)
else
param1
)
)
(cycler init: self &rest)
else
(= cycler 0)
)
)
}}}
That means
"(tentacle setCycle: RandCycle tentacle)"
becomes
"(RandCycle init: tentacle tentacle)"
\\
\\
script 64941 - RandCycle::init()
{{{
(method (init param1 param2 param3 param4)
(super init: param1)
(if (>= argc 4) (= reset param4))
(if reset (client cel: 0))
(= cycleCnt (GetTime))
(if (>= argc 2)
(if (!= param2 -1)
(= count (+ (GetTime) param2))
else
(= count -1)
)
(if (>= argc 3) (= caller param3))
else
(= count -1)
)
)
}}}
This must be why someone added an
[https://bugs.scummvm.org/ticket/10615#comment:6 arithmetic workaround].
RandCycle::doit() does a greater-than op with count.
The extra tentacle arg is being assigned to count!
Strange that ScummVM doesn't panic when init() attempts addition on the
object.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10615#comment:14>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list