guessing the name of the order file if it isn't specified.

This commit is contained in:
Enno Rehling 2006-07-28 22:08:00 +00:00
parent 37143411e1
commit 80e445fe96
1 changed files with 8 additions and 1 deletions

View File

@ -108,9 +108,10 @@
/* libc includes */ /* libc includes */
#include <cstdio> #include <cstdio>
#include <cctype> #include <cctype>
#include <climits>
#include <clocale>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include <clocale>
#if defined(USE_DMALLOC) #if defined(USE_DMALLOC)
# define CLEANUP_CODE # define CLEANUP_CODE
@ -537,6 +538,12 @@ read_args(int argc, char **argv, lua_State * luaState)
} }
} }
if (orders==NULL) {
static char orderfile[MAX_PATH];
sprintf(orderfile, "%s/orders.%d", basepath(), turn);
orders = orderfile;
}
/* add some more variables to the lua globals */ /* add some more variables to the lua globals */
setLuaString(luaState, "datapath", datapath()); setLuaString(luaState, "datapath", datapath());
setLuaString(luaState, "scriptpath", script_path); setLuaString(luaState, "scriptpath", script_path);