From 77a0e77bf6c75b7853526a29f6746d65dac851e0 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 18 Apr 2023 05:29:58 -0400 Subject: [PATCH] Move level load scripting to P_PostLoadLevel Means these scripts get to have an accurate count of the number of players. --- src/p_setup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 35010f715..32f0766eb 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8084,13 +8084,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) { marathonmode |= MA_INIT; } - - P_MapStart(); // just in case MapLoad modifies tm.thing - - ACS_RunLevelStartScripts(); - LUA_HookInt(gamemap, HOOK(MapLoad)); - - P_MapEnd(); // just in case MapLoad modifies tm.thing } else { @@ -8128,6 +8121,13 @@ void P_PostLoadLevel(void) marathonmode &= ~MA_INIT; } + P_MapStart(); // just in case MapLoad modifies tm.thing + + ACS_RunLevelStartScripts(); + LUA_HookInt(gamemap, HOOK(MapLoad)); + + P_MapEnd(); // just in case MapLoad modifies tm.thing + // We're now done loading the level. levelloading = false; }