mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Fix Lua crashes when loading without addons
This commit is contained in:
parent
9abbd2d1b3
commit
6fe54eafba
3 changed files with 9 additions and 1 deletions
|
|
@ -45,6 +45,7 @@
|
||||||
#include "dehacked.h" // get_number (for ghost thok)
|
#include "dehacked.h" // get_number (for ghost thok)
|
||||||
#include "lua_script.h" // LUA_ArchiveDemo and LUA_UnArchiveDemo
|
#include "lua_script.h" // LUA_ArchiveDemo and LUA_UnArchiveDemo
|
||||||
#include "lua_hook.h"
|
#include "lua_hook.h"
|
||||||
|
#include "lua_libs.h" // gL (Lua state)
|
||||||
#include "b_bot.h"
|
#include "b_bot.h"
|
||||||
#include "m_cond.h" // condition sets
|
#include "m_cond.h" // condition sets
|
||||||
#include "md5.h" // demo checksums
|
#include "md5.h" // demo checksums
|
||||||
|
|
@ -7538,7 +7539,12 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
// so this is where we are to read our lua variables (if possible!)
|
// so this is where we are to read our lua variables (if possible!)
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (demoflags & DF_LUAVARS) // again, used for compability, lua shit will be saved to replays regardless of if it's even been loaded
|
if (demoflags & DF_LUAVARS) // again, used for compability, lua shit will be saved to replays regardless of if it's even been loaded
|
||||||
|
{
|
||||||
|
if (!gL) // No Lua state! ...I guess we'll just start one...
|
||||||
|
LUA_ClearState();
|
||||||
|
|
||||||
LUA_UnArchiveDemo();
|
LUA_UnArchiveDemo();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
splitscreen = 0;
|
splitscreen = 0;
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ static int noglobals(lua_State *L)
|
||||||
|
|
||||||
// Clear and create a new Lua state, laddo!
|
// Clear and create a new Lua state, laddo!
|
||||||
// There's SCRIPTIN to be had!
|
// There's SCRIPTIN to be had!
|
||||||
static void LUA_ClearState(void)
|
void LUA_ClearState(void)
|
||||||
{
|
{
|
||||||
lua_State *L;
|
lua_State *L;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
void LUA_ClearExtVars(void);
|
void LUA_ClearExtVars(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void LUA_ClearState(void);
|
||||||
|
|
||||||
void LUA_LoadLump(UINT16 wad, UINT16 lump);
|
void LUA_LoadLump(UINT16 wad, UINT16 lump);
|
||||||
#ifdef LUA_ALLOW_BYTECODE
|
#ifdef LUA_ALLOW_BYTECODE
|
||||||
void LUA_DumpFile(const char *filename);
|
void LUA_DumpFile(const char *filename);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue