correct casting for tolua

This commit is contained in:
Enno Rehling 2009-07-21 07:08:41 +00:00
parent 60e99b9a00
commit 98867c2e2c
5 changed files with 11 additions and 12 deletions

View file

@ -607,7 +607,6 @@ cr_output_ship(FILE * F, const ship * sh, const unit * u, int fcaptain, const fa
/* calculate cargo */ /* calculate cargo */
if (u && (u->faction == f || omniscient(f))) { if (u && (u->faction == f || omniscient(f))) {
static int rule_capacity = -1;
int n = 0, p = 0; int n = 0, p = 0;
int mweight = shipcapacity(sh); int mweight = shipcapacity(sh);
int mcabins = sh->type->cabins; int mcabins = sh->type->cabins;

View file

@ -10,12 +10,12 @@ SOURCES =
alchemy.c alchemy.c
alliance.c alliance.c
battle.c battle.c
border.c
build.c build.c
building.c building.c
calendar.c calendar.c
curse.c
command.c command.c
connection.c
curse.c
eressea.c eressea.c
equipment.c equipment.c
faction.c faction.c

View file

@ -89,7 +89,7 @@ extern void set_info_function(void (*callback)(struct window *, const struct sta
#define TWIDTH 2 /* width of tile */ #define TWIDTH 2 /* width of tile */
#define THEIGHT 1 /* height of tile */ #define THEIGHT 1 /* height of tile */
#if WIN32 #ifdef WIN32
#define wxborder(win) wborder(win, 0, 0, 0, 0, 0, 0, 0, 0) #define wxborder(win) wborder(win, 0, 0, 0, 0, 0, 0, 0, 0)
#else #else
#define wxborder(win) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+') #define wxborder(win) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+')

View file

@ -135,7 +135,7 @@ tolua_region_get_owner(lua_State* L)
region* r = (region*) tolua_tousertype(L, 1, 0); region* r = (region*) tolua_tousertype(L, 1, 0);
if (r) { if (r) {
struct faction * f = region_get_owner(r); struct faction * f = region_get_owner(r);
tolua_pushusertype(L, f, "faction"); tolua_pushusertype(L, f, TOLUA_CAST "faction");
return 1; return 1;
} }
return 0; return 0;

View file

@ -1,10 +1,6 @@
-- the locales that this gameworld supports. -- the locales that this gameworld supports.
local locales = { "de", "en" } local locales = { "de", "en" }
local confirmed_multis = { local confirmed_multis = {
"agve", "dbgi", "7jfa", "qbki",
"gu8y", "wgxe", "iwp0", "r8vz",
"78xt", "34fu", "z33r", "fLkr",
"yuok"
} }
local suspected_multis = { local suspected_multis = {
} }
@ -168,11 +164,15 @@ function process(orders)
end end
kill_multis(confirmed_multis) kill_multis(confirmed_multis)
plan_monsters() -- plan_monsters()
local nmrs = get_nmrs(1) local nmrs = get_nmrs(1)
if nmrs >= 80 then -- nmrs = 0
print("Shit. More than 80 factions with 1 NMR (" .. nmrs .. ")") if maxnmrs == nil then
maxnmrs = 30
end
if nmrs >= maxnmrs then
print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")")
write_summary() write_summary()
write_game("aborted.dat") write_game("aborted.dat")
return -1 return -1