forked from github/server
compilation fixes GCC.
This commit is contained in:
parent
43422a0619
commit
77b292e05a
10 changed files with 26 additions and 13 deletions
|
@ -153,8 +153,8 @@ if ! $(DEBUG) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(MSPACES) {
|
if $(MSPACES) {
|
||||||
CCFLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
|
CCFLAGS += -DMSPACES -DDL_DEBUG=0 ;
|
||||||
C++FLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
|
C++FLAGS += -DMSPACES -DDL_DEBUG=0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(WITHOUT_LUA) {
|
if $(WITHOUT_LUA) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ a_readgive(attrib * a, struct storage * store)
|
||||||
{
|
{
|
||||||
give_data * gdata = (give_data*)a->data.v;
|
give_data * gdata = (give_data*)a->data.v;
|
||||||
variant var;
|
variant var;
|
||||||
int result;
|
|
||||||
char zText[32];
|
char zText[32];
|
||||||
|
|
||||||
var.i = store->r_id(store);
|
var.i = store->r_id(store);
|
||||||
|
|
|
@ -43,6 +43,8 @@ SOURCES =
|
||||||
terrain.c
|
terrain.c
|
||||||
unit.c
|
unit.c
|
||||||
xmlreader.c
|
xmlreader.c
|
||||||
|
textstore.c
|
||||||
|
binarystore.c
|
||||||
;
|
;
|
||||||
|
|
||||||
Library kernel : $(SOURCES) ;
|
Library kernel : $(SOURCES) ;
|
||||||
|
|
|
@ -64,6 +64,7 @@ struct ship;
|
||||||
struct ship_type;
|
struct ship_type;
|
||||||
struct skill;
|
struct skill;
|
||||||
struct spell;
|
struct spell;
|
||||||
|
struct storage;
|
||||||
struct strlist;
|
struct strlist;
|
||||||
struct terrain_type;
|
struct terrain_type;
|
||||||
struct unit;
|
struct unit;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct storage;
|
||||||
typedef void (*afun)(void);
|
typedef void (*afun)(void);
|
||||||
|
|
||||||
typedef struct attrib {
|
typedef struct attrib {
|
||||||
|
|
|
@ -21,7 +21,8 @@ extern "C" {
|
||||||
|
|
||||||
struct attrib;
|
struct attrib;
|
||||||
struct trigger;
|
struct trigger;
|
||||||
|
struct storage;
|
||||||
|
|
||||||
typedef struct trigger_type {
|
typedef struct trigger_type {
|
||||||
const char * name;
|
const char * name;
|
||||||
void (*initialize)(struct trigger *);
|
void (*initialize)(struct trigger *);
|
||||||
|
|
|
@ -268,9 +268,11 @@ static const struct {
|
||||||
{"", luaopen_base},
|
{"", luaopen_base},
|
||||||
{LUA_TABLIBNAME, luaopen_table},
|
{LUA_TABLIBNAME, luaopen_table},
|
||||||
{LUA_IOLIBNAME, luaopen_io},
|
{LUA_IOLIBNAME, luaopen_io},
|
||||||
{LUA_OSLIBNAME, luaopen_os},
|
|
||||||
{LUA_STRLIBNAME, luaopen_string},
|
{LUA_STRLIBNAME, luaopen_string},
|
||||||
{LUA_MATHLIBNAME, luaopen_math},
|
{LUA_MATHLIBNAME, luaopen_math},
|
||||||
|
#if LUA_VERSION_NUM>=501
|
||||||
|
{LUA_OSLIBNAME, luaopen_os},
|
||||||
|
#endif
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
function open_game(turn)
|
||||||
|
file = "" .. get_turn()
|
||||||
|
if read_game(file .. ".dat", "binary")~=0 then
|
||||||
|
return read_game(file, "text")
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
function write_emails(locales)
|
function write_emails(locales)
|
||||||
local files = {}
|
local files = {}
|
||||||
local key
|
local key
|
||||||
|
|
|
@ -9,6 +9,8 @@ function loadscript(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
loadscript("default.lua")
|
||||||
|
|
||||||
function change_locales()
|
function change_locales()
|
||||||
-- local localechange = { }
|
-- local localechange = { }
|
||||||
local localechange = { en = { "adun" } }
|
local localechange = { en = { "adun" } }
|
||||||
|
@ -29,7 +31,6 @@ function run_scripts()
|
||||||
"spells.lua",
|
"spells.lua",
|
||||||
"extensions.lua",
|
"extensions.lua",
|
||||||
"familiars.lua",
|
"familiars.lua",
|
||||||
"default.lua",
|
|
||||||
"eressea/eternath.lua",
|
"eressea/eternath.lua",
|
||||||
"eressea/wedding-jadee.lua",
|
"eressea/wedding-jadee.lua",
|
||||||
"eressea/ponnuki.lua",
|
"eressea/ponnuki.lua",
|
||||||
|
@ -53,8 +54,7 @@ function process(orders)
|
||||||
equipment_setitem("new_faction", "stone", "30");
|
equipment_setitem("new_faction", "stone", "30");
|
||||||
equipment_setitem("new_faction", "money", "4200");
|
equipment_setitem("new_faction", "money", "4200");
|
||||||
|
|
||||||
file = "" .. get_turn()
|
if open_game(get_turn())~=0 then
|
||||||
if read_game(file)~=0 then
|
|
||||||
print("could not read game")
|
print("could not read game")
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
@ -102,8 +102,8 @@ function process(orders)
|
||||||
|
|
||||||
write_files(locales)
|
write_files(locales)
|
||||||
|
|
||||||
file = "" .. get_turn()
|
file = "" .. get_turn() .. ".dat"
|
||||||
if write_game(file)~=0 then
|
if write_game(file, "binary")~=0 then
|
||||||
print("could not write game")
|
print("could not write game")
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,8 +3,7 @@ local locales = { "de", "en" }
|
||||||
|
|
||||||
function process(orders)
|
function process(orders)
|
||||||
-- read game and orders
|
-- read game and orders
|
||||||
local turnfile = "" .. get_turn()
|
if open_game(get_turn())~=0 then
|
||||||
if read_game(turnfile)~=0 then
|
|
||||||
print("could not read game")
|
print("could not read game")
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
@ -40,7 +39,7 @@ function process(orders)
|
||||||
|
|
||||||
-- save the game
|
-- save the game
|
||||||
outfile = "" .. get_turn()
|
outfile = "" .. get_turn()
|
||||||
if write_game(outfile)~=0 then
|
if write_game(outfile, "text")~=0 then
|
||||||
print("could not write game")
|
print("could not write game")
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue