forked from github/server
making combined compiling work again
fixing some warnings that happen in release mode only
This commit is contained in:
parent
ba644a2e68
commit
15d08ab901
|
@ -0,0 +1,51 @@
|
||||||
|
SubDir TOP combined ;
|
||||||
|
|
||||||
|
TargetDirectory ;
|
||||||
|
SubDirHdrs $(SUBDIR)/../eressea ;
|
||||||
|
SubDirHdrs $(SUBDIR)/../common/gamecode ;
|
||||||
|
SubDirHdrs $(SUBDIR)/../common/kernel ;
|
||||||
|
SubDirHdrs $(SUBDIR)/../common/util ;
|
||||||
|
SubDirHdrs $(SUBDIR)/../common ;
|
||||||
|
SubDirHdrs $(SUBDIR)/.. ;
|
||||||
|
|
||||||
|
UsingLua ;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(TOP) common iniparser ] ;
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) curses ] ;
|
||||||
|
if $(BINDINGS) = LUABIND {
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) lua ] ;
|
||||||
|
}
|
||||||
|
if $(BINDINGS) = TOLUA {
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) tolua ] ;
|
||||||
|
}
|
||||||
|
SubDirC++Flags -DHAVE_LUA ;
|
||||||
|
|
||||||
|
SubDirHdrs $(XMLHDRS) ;
|
||||||
|
|
||||||
|
SERVER = eressea ;
|
||||||
|
|
||||||
|
SERVER_SOURCES =
|
||||||
|
curses.c
|
||||||
|
gamecode.c
|
||||||
|
kernel.c
|
||||||
|
stdafx.c
|
||||||
|
util.c
|
||||||
|
main.cpp
|
||||||
|
;
|
||||||
|
|
||||||
|
if $(BINDINGS) = LUABIND {
|
||||||
|
SERVER_SOURCES += bindings.cpp ;
|
||||||
|
libluabind $(SERVER) ;
|
||||||
|
}
|
||||||
|
if $(BINDINGS) = TOLUA {
|
||||||
|
libtolua $(SERVER) ;
|
||||||
|
}
|
||||||
|
liblua $(SERVER) ;
|
||||||
|
|
||||||
|
# eressea-server with lua scripting
|
||||||
|
libxml2 $(SERVER) ;
|
||||||
|
libcurses $(SERVER) ;
|
||||||
|
libmcheck $(SERVER) ;
|
||||||
|
|
||||||
|
LINKLIBS on $(SERVER) += -lm -ldl -lstdc++ ;
|
||||||
|
Main $(SERVER) : $(SERVER_SOURCES) ;
|
|
@ -0,0 +1 @@
|
||||||
|
#include <eressea/server.cpp>
|
|
@ -11,6 +11,8 @@
|
||||||
* This program may not be used, modified or distributed without
|
* This program may not be used, modified or distributed without
|
||||||
* prior permission by the authors of Eressea.
|
* prior permission by the authors of Eressea.
|
||||||
*/
|
*/
|
||||||
|
#ifndef H_ATTRIBUTE_MATMOD
|
||||||
|
#define H_ATTRIBUTE_MATMOD
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -26,3 +28,5 @@ extern struct attrib * make_matmod(mm_fun function);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -432,6 +432,14 @@ i_find(item ** i, const item_type * it)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item * const *
|
||||||
|
i_findc(item * const * i, const item_type * it)
|
||||||
|
{
|
||||||
|
while (*i && (*i)->type!=it) {
|
||||||
|
i = &(*i)->next;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
i_get(const item * i, const item_type * it)
|
i_get(const item * i, const item_type * it)
|
||||||
|
@ -621,7 +629,7 @@ int
|
||||||
get_item(const unit * u, item_t it)
|
get_item(const unit * u, item_t it)
|
||||||
{
|
{
|
||||||
const item_type * type = olditemtype[it];
|
const item_type * type = olditemtype[it];
|
||||||
item * i = *i_find((item**)&u->items, type);
|
const item * i = *i_findc(&u->items, type);
|
||||||
if (i) assert(i->number>=0);
|
if (i) assert(i->number>=0);
|
||||||
return i?i->number:0;
|
return i?i->number:0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ extern const potion_type * resource2potion(const resource_type * i);
|
||||||
extern const luxury_type * resource2luxury(const resource_type * i);
|
extern const luxury_type * resource2luxury(const resource_type * i);
|
||||||
|
|
||||||
extern item ** i_find(item ** pi, const item_type * it);
|
extern item ** i_find(item ** pi, const item_type * it);
|
||||||
|
extern item * const * i_findc(item * const * pi, const item_type * it);
|
||||||
extern item * i_add(item ** pi, item * it);
|
extern item * i_add(item ** pi, item * it);
|
||||||
extern void i_merge(item ** pi, item ** si);
|
extern void i_merge(item ** pi, item ** si);
|
||||||
extern item * i_remove(item ** pi, item * it);
|
extern item * i_remove(item ** pi, item * it);
|
||||||
|
|
|
@ -73,7 +73,7 @@ get_resource(const unit * u, const resource_type * rtype)
|
||||||
} else if (itype==olditemtype[R_IRON] && u->race==rc_irongolem) {
|
} else if (itype==olditemtype[R_IRON] && u->race==rc_irongolem) {
|
||||||
return u->number*GOLEM_IRON;
|
return u->number*GOLEM_IRON;
|
||||||
} else {
|
} else {
|
||||||
const item * i = *i_find((item**)&u->items, itype);
|
const item * i = *i_findc(&u->items, itype);
|
||||||
if (i) return i->number;
|
if (i) return i->number;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue