Author Topic: solitary vaules in QfGIV changeStage switch statement  (Read 3043 times)

0 Members and 2 Guests are viewing this topic.

Offline lskovlun

Re: solitary vaules in QfGIV changeStage switch statement
« Reply #15 on: January 10, 2026, 08:38:07 PM »
Of course, one could imagine a pushlist keyword that would actually do this properly. It would only work if the branches of the if/switch all had the same number of elements (as in the disguise part of the above), otherwise an enhancement to the PMachine would be needed. That would be an advanced usage, because it can potentially corrupt the stack.

Offline lskovlun

Re: solitary vaules in QfGIV changeStage switch statement
« Reply #16 on: January 10, 2026, 08:47:03 PM »
I'm more curious what the original source code looked like that ended up compiling to that. Do any of the games that have had the original code released (there are a few I think, like maybe one of the LSLs?) have logic like that?
Probably used those long defines that Companion doesn't support. Sometimes Sierra had two versions of such defines which were subtly different. Maybe mistaking one for the other?

(or rather, I know that this is it. Some of the other OneOf calls have the exact same list of room numbers. Had to come from a define.)

Offline doomlazer

Re: solitary vaules in QfGIV changeStage switch statement
« Reply #17 on: January 12, 2026, 10:04:52 PM »
Sluicebox managed to trackdown the cause, at least for the code I originally posted about. It's from using case values with switchTo.

SwitchTo doesn't use case values; adding them compiles fine, but leaves behind the garbage. You can see switchTo was used in the LSL1VGA source with case values, which results in the extra values when decompiled.

switchTo is used quite a bit in lsl1vga, and not always incorrectly either!

edit: fixed link
« Last Edit: January 12, 2026, 11:53:42 PM by doomlazer »

Offline lskovlun

Re: solitary vaules in QfGIV changeStage switch statement
« Reply #18 on: January 13, 2026, 09:54:09 AM »
That's a nice find. And switchto was a late addition to the SCI language, so it makes sense.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.044 seconds with 21 queries.