diff --git a/src/p_saveg.c b/src/p_saveg.c index 995b528fa8eac3b370f20b643925935d24faa555..73035f963f0b28b0a2821095f295fab9230de9af 100755 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -35,6 +35,7 @@ #include "lua_script.h" #include "p_setup.h" #include "p_slopes.h" +#include "hashtable.h" //I don't want to use hashtables there, but there will be anyways in the future savedata_t savedata; UINT8 *save_p; @@ -2536,6 +2537,8 @@ static void P_NetArchiveThinkers(void) if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed || th->function.acp1 == (actionf_p1)P_NullPrecipThinker)) numsaved++; + else + continue; if (th->function.acp1 == (actionf_p1)P_MobjThinker) { @@ -5544,6 +5547,9 @@ boolean P_LoadGame(INT16 mapoverride) boolean P_LoadNetGame(boolean reloading) { + mobjnum_ht_linkedList_Init(); //clean up hashtables to avoid lua stuff using them + //this is temporary and will be rewritten to use in vanilla code + //once rollback netcode will be stable CV_LoadNetVars(&save_p); if (!P_NetUnArchiveMisc(reloading)) return false; diff --git a/src/p_savenetrb.c b/src/p_savenetrb.c index 1a186da5fb1d0b865228647f9f4ac845e2553d6e..c8bc0a35cdf7bfe1d7646e738f646b1f1e554ddb 100755 --- a/src/p_savenetrb.c +++ b/src/p_savenetrb.c @@ -2636,6 +2636,8 @@ static void P_NetArchiveThinkers(void) if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed || th->function.acp1 == (actionf_p1)P_NullPrecipThinker)) numsaved++; + else + continue; if (th->function.acp1 == (actionf_p1)P_MobjThinker) { @@ -5882,6 +5884,7 @@ boolean P_LoadGameState(const savestate_t* savestate) INT16 savedGameMap; precise_t currentTime; loadStateBenchmark = I_GetPreciseTime(); + mobjnum_ht_linkedList_Init(); if (savestate->buffer == NULL) { loadStateBenchmark = I_GetPreciseTime() - loadStateBenchmark; @@ -5900,8 +5903,6 @@ boolean P_LoadGameState(const savestate_t* savestate) return false; } - mobjnum_ht_linkedList_Init(); - globalmobjnum = READUINT32(save_p); con_muted = true;