Skip to content

Commit a7b46db

Browse files
authored
Merge pull request #5060 from MjnMixael/fix_mainhall_anims
SCPUI needs to be able run game_close_level
2 parents d2eff1f + 1f7cdca commit a7b46db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

code/scripting/api/libs/mission.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,11 +1456,13 @@ ADE_FUNC(loadMission, l_Mission, "string missionName", "Loads a mission", "boole
14561456
return ADE_RETURN_TRUE;
14571457
}
14581458

1459-
ADE_FUNC(unloadMission, l_Mission, NULL, "Stops the current mission and unloads it", NULL, NULL)
1459+
ADE_FUNC(unloadMission, l_Mission, "[boolean forceUnload]", "Stops the current mission and unloads it. If forceUnload is true "
1460+
"then the mission unload logic will run regardless of if a mission is loaded or not. Use with caution.", nullptr, nullptr)
14601461
{
1461-
SCP_UNUSED(L); // unused parameter
1462+
bool forceUnload = false;
1463+
ade_get_args(L, "|b", &forceUnload);
14621464

1463-
if(Game_mode & GM_IN_MISSION)
1465+
if(forceUnload || Game_mode & GM_IN_MISSION)
14641466
{
14651467
game_level_close();
14661468
Game_mode &= ~GM_IN_MISSION;

0 commit comments

Comments
 (0)