diff --git a/src/combined/Jamfile b/src/combined/Jamfile new file mode 100644 index 000000000..4f29991d9 --- /dev/null +++ b/src/combined/Jamfile @@ -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) ; diff --git a/src/combined/main.cpp b/src/combined/main.cpp new file mode 100644 index 000000000..dc8fb0e50 --- /dev/null +++ b/src/combined/main.cpp @@ -0,0 +1 @@ +#include diff --git a/src/common/attributes/matmod.h b/src/common/attributes/matmod.h index 5324a6e62..8dbce7dab 100644 --- a/src/common/attributes/matmod.h +++ b/src/common/attributes/matmod.h @@ -11,6 +11,8 @@ * This program may not be used, modified or distributed without * prior permission by the authors of Eressea. */ +#ifndef H_ATTRIBUTE_MATMOD +#define H_ATTRIBUTE_MATMOD #ifdef __cplusplus extern "C" { @@ -26,3 +28,5 @@ extern struct attrib * make_matmod(mm_fun function); #ifdef __cplusplus } #endif + +#endif diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 7d8cc2bed..bf55c38ea 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -432,6 +432,14 @@ i_find(item ** i, const item_type * it) return i; } +item * const * +i_findc(item * const * i, const item_type * it) +{ + while (*i && (*i)->type!=it) { + i = &(*i)->next; + } + return i; +} int i_get(const item * i, const item_type * it) @@ -621,7 +629,7 @@ int get_item(const unit * u, item_t 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); return i?i->number:0; } diff --git a/src/common/kernel/item.h b/src/common/kernel/item.h index e1fd7be9b..4557a7d57 100644 --- a/src/common/kernel/item.h +++ b/src/common/kernel/item.h @@ -227,6 +227,7 @@ extern const potion_type * resource2potion(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 * const * i_findc(item * const * pi, const item_type * it); extern item * i_add(item ** pi, item * it); extern void i_merge(item ** pi, item ** si); extern item * i_remove(item ** pi, item * it); diff --git a/src/common/kernel/pool.c b/src/common/kernel/pool.c index 6eff41e2d..562b950a3 100644 --- a/src/common/kernel/pool.c +++ b/src/common/kernel/pool.c @@ -73,7 +73,7 @@ get_resource(const unit * u, const resource_type * rtype) } else if (itype==olditemtype[R_IRON] && u->race==rc_irongolem) { return u->number*GOLEM_IRON; } else { - const item * i = *i_find((item**)&u->items, itype); + const item * i = *i_findc(&u->items, itype); if (i) return i->number; return 0; }