- Lua vm state in global variable

This commit is contained in:
Enno Rehling 2004-06-07 04:53:28 +00:00
parent 476788755b
commit 7a6935daf7
2 changed files with 9 additions and 7 deletions

View File

@ -1157,14 +1157,15 @@ extern const struct race * new_race[];
/* globale settings des Spieles */
typedef struct settings {
const char *gamename;
const char *welcomepath;
unsigned int maxunits;
struct attrib *attribs;
unsigned int data_version;
const char *gamename;
const char *welcomepath;
unsigned int maxunits;
struct attrib *attribs;
unsigned int data_version;
unsigned int data_turn;
boolean disabled[MAXKEYWORDS];
struct param * parameters;
boolean disabled[MAXKEYWORDS];
struct param * parameters;
void * vm_state;
} settings;
extern settings global;

View File

@ -645,6 +645,7 @@ main(int argc, char *argv[])
#endif
lua_State * luaState = lua_init();
global.vm_state = luaState;
if ((i=read_args(argc, argv, luaState))!=0) return i;
strcat(strcpy(zText, resourcepath()), "/timestrings");