Skip to content

Fix Edge-case with $Preload briefing icon models:#6850

Merged
wookieejedi merged 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-icon-preload
Jul 20, 2025
Merged

Fix Edge-case with $Preload briefing icon models:#6850
wookieejedi merged 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-icon-preload

Conversation

@wookieejedi

Copy link
Copy Markdown
Member

Found a very interesting edge case bug with $Preload briefing icon models:.

Situation: Mission 1 has a briefing which has a ship class A as the class (and thus loads the model), but the ship class A is not actually in that mission so no subsystems are loaded. Then in mission 2, the ship class A is actually in the mission but FSO tries to reuse the slot that was loaded, but realizes no subsystems were loaded and makes an error message. I that is because the preload code for the briefing icons on missionparse.cpp line 6664 just calls model_load but does not specify the subsystem argument.

I've also attached a retail mod reproducible campaign (2 missions, first is 5 seconds long). When the second mission loads the incorrect subsystem warning appears. data.zip

This PR properly loads the subsystems and fixes the bug. Tested and works as expected.

Found a very interesting edge case bug with `$Preload briefing icon models:.`

Situation: Mission 1 has a briefing which has a ship class A as the class (and thus loads the model), but the ship class A is not actually in that mission so no subsystems are loaded. Then in mission 2, the ship class A is actually in the mission but FSO tries to reuse the slot that was loaded, but realizes no subsystems were loaded and makes an error message. I that is because the preload code for the briefing icons on `missionparse.cpp` line 6664 just calls `model_load` but does not specify the subsystem argument.

 I've also attached a retail mod reproducible campaign (2 missions, first is 5 seconds long). When the second mission loads the incorrect subsystem warning appears.

This PR properly loads the subsystems and fixes the bug. Tested and works as expected.
@wookieejedi wookieejedi added the fix A fix for bugs, not-a-bugs, and/or regressions. label Jul 20, 2025
@wookieejedi wookieejedi added this to the Release 25.0 milestone Jul 20, 2025
@wookieejedi wookieejedi merged commit 86622e1 into scp-fs2open:master Jul 20, 2025
20 checks passed
@wookieejedi wookieejedi deleted the fix-icon-preload branch July 20, 2025 19:00
Kestrellius pushed a commit to Kestrellius/fs2open.github.com that referenced this pull request Jul 26, 2025
Found a very interesting edge case bug with `$Preload briefing icon models:.`

Situation: Mission 1 has a briefing which has a ship class A as the class (and thus loads the model), but the ship class A is not actually in that mission so no subsystems are loaded. Then in mission 2, the ship class A is actually in the mission but FSO tries to reuse the slot that was loaded, but realizes no subsystems were loaded and makes an error message. I that is because the preload code for the briefing icons on `missionparse.cpp` line 6664 just calls `model_load` but does not specify the subsystem argument.

 I've also attached a retail mod reproducible campaign (2 missions, first is 5 seconds long). When the second mission loads the incorrect subsystem warning appears.

This PR properly loads the subsystems and fixes the bug. Tested and works as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants