Skip to content

Cutscene and IFF tables: scope +nocreate to its own entry - #8079

Open
AdmiralTolwyn wants to merge 1 commit into
scp-fs2open:masterfrom
AdmiralTolwyn:nocreate-leak
Open

AdmiralTolwyn wants to merge 1 commit into
scp-fs2open:masterfrom
AdmiralTolwyn:nocreate-leak

Conversation

@AdmiralTolwyn

Copy link
Copy Markdown
Contributor

In a -csn.tbm or -iff.tbm, once an entry uses +nocreate, every later entry in the same file that names a new cutscene or IFF is silently skipped. Both parsers declare the creation flag once per file, +nocreate sets it to false, and nothing sets it back. This declares it inside the per-entry loop, as the other +nocreate parsers already do (medals, scoring, nebula and props in the loop; ships, weapons, AI classes and others in a per-entry parse function). No other parser has the same problem.

What mods could notice: new entries after a +nocreate entry in the same modular table now load. A +nocreate entry that names a missing cutscene or IFF is still skipped, and base tables are unaffected.

Testing

  • A new cutscene parser test, and the existing modular IFF fixture now overrides Unknown with +nocreate before it adds Pirate, then ends with a +nocreate entry for an IFF that does not exist. Against master's parsers both tests fail because the new entry is missing.
  • macOS arm64, Release: 373 passed, 1 skipped (OptionsManagerOverride.ShadowRenderMethodDefaultFollowsTheGlobal, unrelated).
  • Retail FS2 data with a -csn.tbm and an -iff.tbm of the same shape, read back by a Lua hook at the main menu: master skipped the new cutscene and the new IFF; this PR loads both. The +nocreate entries for missing targets stay absent in both.

parse_cutscene_table() and parse_iff_table() declared create_if_not_found
once per file. After one +nocreate entry in a modular table, every later
entry naming a new cutscene or IFF was skipped. Declare the flag inside
the per-entry loop, as the other +nocreate parsers do.
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.

1 participant