KEMBAR78
GLK: SCOTT: Fix inverted conditional statement by angstsmurf · Pull Request #4728 · scummvm/scummvm · GitHub
Skip to content

Conversation

@angstsmurf
Copy link
Contributor

@angstsmurf angstsmurf commented Feb 21, 2023

Line 255, if (!(_G(_game)->_subType & (C64 | MYSTERIOUS))), is supposed to check whether the current game is a Commodore 64 version of one of the eleven Mysterious Adventures by Brian Howarth, and if so set the appropriate system messages. Currently it does the opposite.

A one-character change that may also fix Fixes https://bugs.scummvm.org/ticket/14255.

EDIT: Now it is properly fixed.

EDIT 2: The lines 139-263 in load_game.cpp set the entries of the Common::StringArray _sys to the right string from _systemMessages, which contains strings read from the original game data.

All Scott Adams format games have roughly the same system messages, but to save memory they may omit the unused ones, so that a game without treasures might skip all treasure-related messages such as "You have stored X treasures", for example. Therefore, the strings read from the game data (into _systemMessages) have to be rearranged so that _sys has the expected messages in the expected order.

Conveniently, all the Commodore 64 Mysterious Adventures have the same messages in the same order in their game data, so they get their own function, mysterious64Sysmess().

Questprobe featuring the Hulk, however, is a little different, and has a completely blank array of _systemMessages. This is because unlike the other games, it does not has it system messages neatly ordered as a table at a single place in the data, but they are individually dispersed throughout the code. It was decided that it was too much work to extract them all. Instead it uses the boilerplate built-in fallback messages listed in game_info.cpp.

So what happens currently is that, because the conditional statement at line 255 is inverted, every game not a Commodore 64 game or a "Mysterious Adventure" gets its system messages set by mysterious64Sysmess(). And in The Hulk's case, this means that it gets a lot of empty strings as system messages, resulting in ticket 14255.

@angstsmurf angstsmurf changed the title GLK: SCOTT: Fix inverted condition GLK: SCOTT: Fix inverted conditional statement Feb 22, 2023
@dreammaster dreammaster merged commit ba1836a into scummvm:master Feb 24, 2023
@dreammaster
Copy link
Member

Thanks for noticing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants