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

@@ -344,6 +344,7 @@ savegamestate(NHFILE *nhfp)
savenames(nhfp);
save_msghistory(nhfp);
save_gamelog(nhfp);
save_luadata(nhfp);
if (nhfp->structlevel)
bflush(nhfp->fd);
gp.program_state.saving--;