Lua: Persistent variables

Add a way for the lua scripts to set and retrieve variables
that are persistent - saved and restored with the game.

Invalidates saves.
This commit is contained in:
Pasi Kallinen
2023-01-15 10:32:31 +02:00
parent 18cc99150a
commit 6abb12aee0
8 changed files with 194 additions and 1 deletions

View File

@@ -1839,6 +1839,9 @@ extern void l_nhcore_call(int);
extern lua_State * nhl_init(nhl_sandbox_info *);
extern void nhl_done(lua_State *);
extern boolean nhl_loadlua(lua_State *, const char *);
extern char *get_nh_lua_variables(void);
extern void save_luadata(NHFILE *);
extern void restore_luadata(NHFILE *);
extern int nhl_pcall(lua_State *, int, int);
extern boolean load_lua(const char *, nhl_sandbox_info *);
ATTRNORETURN extern void nhl_error(lua_State *, const char *) NORETURN;

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 68
#define EDITLEVEL 69
/*
* Development status possibilities.