diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4580f5f3e..ff5730feb 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9749,6 +9749,28 @@ static void G_Startup(void) setbasepaltable(basepaltable, BASEPALCOUNT); +#ifdef LUNATIC + if ((i = El_CreateState(&g_ElState, "test"))) + { + initprintf("Lunatic: Error initializing global ELua state (code %d)\n", i); + } + else + { + extern const char luaJIT_BC_defs[]; + + if ((i = L_RunString(&g_ElState, (char *)luaJIT_BC_defs, 0, + LUNATIC_DEFS_BC_SIZE, "defs.ilua"))) + { + initprintf("Lunatic: Error preparing global ELua state (code %d)\n", i); + El_DestroyState(&g_ElState); + } + } + + if (i) + G_GameExit("Failure setting up Lunatic!"); + C_InitQuotes(); +#endif + G_InitDynamicTiles(); A_InitEnemyFlags(); @@ -10452,6 +10474,7 @@ int32_t app_main(int32_t argc, const char **argv) } #endif numplayers = 1; + playerswhenstarted = ud.multimode; // Lunatic needs this (player[] bound) if (!g_fakeMultiMode) { @@ -10459,8 +10482,6 @@ int32_t app_main(int32_t argc, const char **argv) } else { - playerswhenstarted = ud.multimode; - for (i=0; i