diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b4d0c39c4..b22565421 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9885,6 +9885,13 @@ void El_CreateGameState(void) } #endif +// Throw in everything here that needs to be called after a Lua game state +// recreation (or on initial startup in a non-Lunatic build.) +void G_PostCreateGameState(void) +{ + A_InitEnemyFlags(); +} + static void G_Startup(void) { int32_t i; @@ -9912,7 +9919,7 @@ static void G_Startup(void) #endif G_InitDynamicTiles(); - A_InitEnemyFlags(); + G_PostCreateGameState(); if (g_netServer || ud.multimode > 1) G_CheckGametype(); diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index 2b37678a4..c2dd75b75 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -299,6 +299,7 @@ void Yax_SetBunchZs(int32_t sectnum, int32_t cf, int32_t daz); #ifdef LUNATIC void El_CreateGameState(void); #endif +void G_PostCreateGameState(void); void A_SpawnCeilingGlass(int32_t i,int32_t sectnum,int32_t n); void A_SpawnGlass(int32_t i,int32_t n); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 50678cf51..b9a4f9a1b 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1119,6 +1119,7 @@ static inline void prelevel(char g) #ifdef LUNATIC El_CreateGameState(); + G_PostCreateGameState(); #endif i = headspritestat[STAT_DEFAULT];