mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Lunatic: initialize test Lua state earlier so that 'setdefname' has an effect.
git-svn-id: https://svn.eduke32.com/eduke32@3528 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e576224bb9
commit
d747e26fd0
1 changed files with 24 additions and 25 deletions
|
@ -9749,6 +9749,28 @@ static void G_Startup(void)
|
||||||
|
|
||||||
setbasepaltable(basepaltable, BASEPALCOUNT);
|
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();
|
G_InitDynamicTiles();
|
||||||
A_InitEnemyFlags();
|
A_InitEnemyFlags();
|
||||||
|
|
||||||
|
@ -10452,6 +10474,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
numplayers = 1;
|
numplayers = 1;
|
||||||
|
playerswhenstarted = ud.multimode; // Lunatic needs this (player[] bound)
|
||||||
|
|
||||||
if (!g_fakeMultiMode)
|
if (!g_fakeMultiMode)
|
||||||
{
|
{
|
||||||
|
@ -10459,8 +10482,6 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerswhenstarted = ud.multimode;
|
|
||||||
|
|
||||||
for (i=0; i<ud.multimode-1; i++)
|
for (i=0; i<ud.multimode-1; i++)
|
||||||
connectpoint2[i] = i+1;
|
connectpoint2[i] = i+1;
|
||||||
connectpoint2[ud.multimode-1] = -1;
|
connectpoint2[ud.multimode-1] = -1;
|
||||||
|
@ -10526,7 +10547,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
playerswhenstarted = ud.multimode;
|
playerswhenstarted = ud.multimode; // XXX: redundant?
|
||||||
ud.last_level = 0;
|
ud.last_level = 0;
|
||||||
|
|
||||||
// the point of this block is to avoid overwriting the default in the cfg while asserting our selection
|
// the point of this block is to avoid overwriting the default in the cfg while asserting our selection
|
||||||
|
@ -10598,28 +10619,6 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
OSD_Exec("autoexec.cfg");
|
OSD_Exec("autoexec.cfg");
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
if (g_networkMode != NET_DEDICATED_SERVER)
|
if (g_networkMode != NET_DEDICATED_SERVER)
|
||||||
{
|
{
|
||||||
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0)
|
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0)
|
||||||
|
|
Loading…
Reference in a new issue