allow -1 sound index in OPF_GAME_SND syntax check#7540
Merged
Conversation
The numeric branch of the OPF_GAME_SND check in check_sexp_syntax never
actually ran until the type2 variable-overload bug was fixed, so missions
using a sound index of -1 ("no sound" / "default") loaded fine. Now that
the check is live, explicitly allow -1, which the runtime already treats as
an invalid (unset) sound. Also return the more descriptive
SEXP_CHECK_INVALID_GAME_SND / SEXP_CHECK_INVALID_FIREBALL error codes, and
let nested-operator (SEXP_ATOM_LIST) arguments fall through since their type
is already validated upstream.
Also route the Lua SEXP soundentry argument through sexp_get_sound_index so
it accepts a table index, an operator, or a name like the core SEXPs do,
instead of only a name.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BMagnu
approved these changes
Jun 20, 2026
BMagnu
left a comment
Member
There was a problem hiding this comment.
Fixes the failed mission loads in my test!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The numeric branch of the OPF_GAME_SND check in check_sexp_syntax never actually ran until the type2 variable-overload bug was fixed, so missions using a sound index of -1 ("no sound" / "default") loaded fine. Now that the check is live, explicitly allow -1, which the runtime already treats as an invalid (unset) sound. Also return the more descriptive SEXP_CHECK_INVALID_GAME_SND / SEXP_CHECK_INVALID_FIREBALL error codes, and let nested-operator (SEXP_ATOM_LIST) arguments fall through since their type is already validated upstream.
Also route the Lua SEXP soundentry argument through sexp_get_sound_index so it accepts a table index, an operator, or a name like the core SEXPs do, instead of only a name.
Follow-up to #7365.