Skip to content

Commit c74d523

Browse files
committed
third attempt at getting past that one guy
1 parent 0bc26ca commit c74d523

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
@@ -1464,11 +1464,13 @@ ADE_FUNC(loadMission, l_Mission, "string missionName", "Loads a mission", "boole
14641464
return ADE_RETURN_TRUE;
14651465
}
14661466

1467-
ADE_FUNC(unloadMission, l_Mission, NULL, "Stops the current mission and unloads it", NULL, NULL)
1467+
ADE_FUNC(unloadMission, l_Mission, "boolean forceUnload", "Stops the current mission and unloads it. If forceUnload is true "
1468+
"then the mission unload logic will run regardless of if a mission is loaded or not. Use with caution.", nullptr, nullptr)
14681469
{
1469-
SCP_UNUSED(L); // unused parameter
1470+
bool forceUnload = false;
1471+
ade_get_args(L, "|b", &forceUnload);
14701472

1471-
if(Game_mode & GM_IN_MISSION)
1473+
if(forceUnload || Game_mode & GM_IN_MISSION)
14721474
{
14731475
game_level_close();
14741476
Game_mode &= ~GM_IN_MISSION;

0 commit comments

Comments
 (0)