[Scummvm-tracker] [ScummVM] #9894: QFG4: Thieves guild secret passage isn't immediately walkable
ScummVM
trac at scummvm.org
Sat Jan 12 05:12:19 CET 2019
#9894: QFG4: Thieves guild secret passage isn't immediately walkable
--------------------------------+----------------------------------------
Reporter: tsoliman | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCI
Resolution: | Keywords: SCI32 original pathfinding
Game: Quest for Glory 4 |
--------------------------------+----------------------------------------
Comment (by Vhati):
Looks like sBarrelMove has derelict code.
At some point during development, it was possible to move the barrel back
and forth, re-hiding the puzzle mechanism. Now it only reveals once and
stays put.
\\
\\
script 340 - barrel::doVerb(4)
{{{
(cond
# Passage revealed flag.
((proc0_4 254)
# "You don't need to do anything else with the
# barrel. Don't bungle the job!"
(global91 say: 6 4 27)
)
# Desk opened flag.
((proc0_4 241)
# x=116 if the barrel has already been moved to reveal the
puzzle.
(if (== x 116)
(g2_myCurrentRoom setScript: sBarrelMove 0 1)
else
(g2_myCurrentRoom setScript: sBarrelMove 0 0)
)
# Those lines schedule sBarrelMove with "register" set to
1 or 0.
)
(else
# "There does seem to be something under this barrel,
# but you've got no clue of what to do with it."
(g91_gloryMessager say: 6 4 104)
)
)
}}}
Because a cond block short-circuits, if sBarrelMove is scheduled, flag 254
can't have been set. So when sBarrelMove tests the flag, it will always be
false.
\\
\\
\\
script 340 - sBarrelMove::changeState()
{{{
(0
0
(global1 handsOff:)
(if
# x=116 and register=1 are synonymous.
# Flag 254 is never true here.
(and (== (barrel x?) 116) (not (proc0_4 254)))
(self changeState: 6)
else
# States 1-5 will only run with x != 116, aka register=0.
(= cycles 1)
)
)
# ...
(2
2
(if register
# "You slide the barrel back into place covering
# the lock mechanism."
(global91 say: 6 4 18 0 self)
else
# "You depress the barrel tap, but nothing comes out.
# Instead, the barrel slides across the wall to reveal
# some sort of mechanism."
(global91 say: 6 4 19 0 self)
)
)
(3
3
(barrel setLoop:)
(if register
(barrel setMotion: MoveTo 132 148 self)
else
(barrel setMotion: MoveTo 116 148 self)
)
)
# ...
(5
5
(g0_hero
normalize:
cycleSpeed: local4
posn: (if register 149 else 159) 131
)
(if register (= state 11))
(= cycles 1)
)
}}}
Any code in states 1-5 based on register=1 is derelict.
--
Ticket URL: <https://bugs.scummvm.org/ticket/9894#comment:12>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list