Load/Saved Map properly with multiple load/saves

This commit is contained in:
wizzard 2004-01-31 06:18:21 +00:00
parent 9aa858f474
commit 3a52711a06
2 changed files with 4 additions and 1 deletions

View file

@ -84,6 +84,7 @@ global void SaveMap(CLFile* file)
CLprintf(file, " \"size\", {%d, %d},\n", TheMap.Width, TheMap.Height);
CLprintf(file, " \"%s\",\n", TheMap.NoFogOfWar ? "no-fog-of-war" : "fog-of-war");
CLprintf(file, " \"filename\", \"%s\",\n", TheMap.Info->Filename);
CLprintf(file, " \"map-fields\", {\n");
for (h = 0; h < TheMap.Height; ++h) {

View file

@ -152,7 +152,9 @@ local int CclStratagusMap(lua_State* l)
TheMap.NoFogOfWar = 1;
--k;
} else if (!strcmp(value, "filename")) {
TheMap.Info->Filename = strdup(LuaToString(l, k + 1));
lua_rawgeti(l, j + 1, k + 1);
TheMap.Info->Filename = strdup(LuaToString(l, -1));
lua_pop(l, 1);
} else if (!strcmp(value, "map-fields")) {
int i;
int subsubargs;