diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 5fe6c3ff2..4649c0eee 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -676,7 +676,7 @@ cr_output_unit(FILE * F, const region * r, assert(u); -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_HIDDEN)) a_fshidden = a_find(u->attribs, &at_fshidden); #endif /* KARMA_MODULE */ @@ -1149,7 +1149,7 @@ report_computer(const char * filename, report_context * ctx, const char * charse const char * mailto = locale_string(f->locale, "mailto"); const attrib * a; seen_region * sr = NULL; -#ifdef SCORE_MODULE +#if SCORE_MODULE int score = 0, avgscore = 0; #endif int enc = xmlParseCharEncoding(charset); @@ -1186,7 +1186,7 @@ report_computer(const char * filename, report_context * ctx, const char * charse fprintf(F, "\"%s\";locale\n", locale_name(f->locale)); fprintf(F, "%d;age\n", f->age); fprintf(F, "%d;Optionen\n", f->options); -#ifdef SCORE_MODULE +#if SCORE_MODULE if (f->options & want(O_SCORE) && f->age>DISPLAYSCORE) { score = f->score; avgscore = average_score_of_age(f->age, f->age / 24 + 1); diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 66e00e00a..b66ded643 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -233,7 +233,7 @@ add_recruits(unit * u, int number, int wanted) assert(number<=wanted); if (number > 0) { unit * unew; -#ifdef KARMA_MODULE +#if KARMA_MODULE int i = fspecial(u->faction, FS_MILITIA); #endif /* KARMA_MODULE */ @@ -253,7 +253,7 @@ add_recruits(unit * u, int number, int wanted) change_level(unew, SK_RIDING, 1); } -#ifdef KARMA_MODULE +#if KARMA_MODULE if (i > 0) { if (unew->race->bonus[SK_SPEAR] >= 0) change_level(unew, SK_SPEAR, i); diff --git a/src/common/gamecode/give.c b/src/common/gamecode/give.c index 96654e087..f1cf54b99 100644 --- a/src/common/gamecode/give.c +++ b/src/common/gamecode/give.c @@ -118,7 +118,7 @@ give_item(int want, const item_type * itype, unit * src, unit * dest, struct ord } #endif #endif -#if defined(MUSEUM_MODULE) && defined(TODO) +#if MUSEUM_MODULE && defined(TODO) /* TODO: use a trigger for the museum warden! */ if (a_find(dest->attribs, &at_warden)) { warden_add_give(src, dest, itype, n); diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 6cb51c150..855108559 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -25,7 +25,7 @@ #include #include -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE #include #endif @@ -3048,7 +3048,7 @@ maxunits(const faction *f) if (global.unitsperalliance == true) { float mult = 1.0; -#ifdef KARMA_MODULE +#if KARMA_MODULE faction *f2; for (f2 = factions; f2; f2 = f2->next) { if (f2->alliance == f->alliance) { @@ -3058,7 +3058,7 @@ maxunits(const faction *f) #endif /* KARMA_MODULE */ return (int) (global.maxunits * mult); } -#ifdef KARMA_MODULE +#if KARMA_MODULE return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR))); #else return global.maxunits; @@ -3354,7 +3354,7 @@ monthly_healing(void) continue; } -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_UNDEAD)) continue; if(fspecial(u->faction, FS_REGENERATION)) { @@ -3834,7 +3834,7 @@ init_processor(void) add_proc_order(p, K_NAME, &name_cmd, 0, NULL); add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL); add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL); -#ifdef KARMA_MODULE +#if KARMA_MODULE add_proc_order(p, K_WEREWOLF, &setwere_cmd, 0, NULL); #endif /* KARMA_MODULE */ @@ -3857,7 +3857,7 @@ init_processor(void) add_proc_global(p, &alliancevictory, "Testen der Allianzbedingungen"); } -#ifdef INFOCMD_MODULE +#if INFOCMD_MODULE add_proc_global(p, &infocommands, NULL); #endif add_proc_global(p, &gmcommands, "GM Kommandos"); @@ -3866,7 +3866,7 @@ init_processor(void) add_proc_order(p, K_LEAVE, &leave_cmd, 0, "Verlassen"); if (!nobattle) { -#ifdef KARMA_MODULE +#if KARMA_MODULE p+=10; add_proc_global(p, &jihad_attacks, "Jihad-Angriffe"); #endif @@ -3920,7 +3920,7 @@ init_processor(void) p+=10; add_proc_order(p, K_GUARD, &guard_on_cmd, 0, "Bewache (an)"); -#ifdef XECMD_MODULE +#if XECMD_MODULE /* can do together with guard */ add_proc_order(p, K_LEAVE, &xecmd, 0, "Zeitung"); #endif @@ -3945,7 +3945,7 @@ init_processor(void) p+=10; add_proc_global(p, &reorder, "Einheiten sortieren"); -#ifdef KARMA_MODULE +#if KARMA_MODULE p+=10; add_proc_global(p, &karma, "Jihads setzen"); #endif @@ -3985,7 +3985,7 @@ processorders (void) ageing(); remove_empty_units(); -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE create_wormholes(); #endif /* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich diff --git a/src/common/gamecode/luck.c b/src/common/gamecode/luck.c index b527e9624..56c4b9046 100644 --- a/src/common/gamecode/luck.c +++ b/src/common/gamecode/luck.c @@ -53,7 +53,7 @@ #include #include -#ifdef KARMA_MODULE +#if KARMA_MODULE #define STANDARD_LUCK 0 diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index ce89f7000..916014a1b 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -612,7 +612,7 @@ drown(region *r) unit ** up = up=&r->units; while (*up) { unit *u = *up; -#ifdef KARMA_MODULE +#if KARMA_MODULE int amphibian_level = fspecial(u->faction, FS_AMPHIBIAN); #else int amphibian_level = 0; @@ -1121,7 +1121,7 @@ icebergs(void) void randomevents(void) { -#ifdef KARMA_MODULE +#if KARMA_MODULE faction *f; #endif /* KARMA_MODULE */ region *r; @@ -1217,7 +1217,7 @@ randomevents(void) } } -#ifdef KARMA_MODULE +#if KARMA_MODULE /* lycanthropen werden werwölfe */ for (f = factions; f; f=f->next) { if (f->alive) { @@ -1273,7 +1273,7 @@ randomevents(void) dissolve_units(); check_split(); -#ifdef KARMA_MODULE +#if KARMA_MODULE check_luck(); #endif /* KARMA_MODULE */ } diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 8b6d3b4ea..4cae98090 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -1944,7 +1944,7 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars centre(F, alliancename(f->alliance), true); } -#ifdef KARMA_MODULE +#if KARMA_MODULE buf[0] = 0; dh = 0; for (a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) { @@ -1996,7 +1996,7 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars } } rnl(F); -#ifdef SCORE_MODULE +#if SCORE_MODULE if (f->options & want(O_SCORE) && f->age > DISPLAYSCORE) { RENDER(f, buf, sizeof(buf), ("nr_score", "score average", f->score, average_score_of_age(f->age, f->age / 24 + 1))); centre(F, buf, true); diff --git a/src/common/gamecode/spy.c b/src/common/gamecode/spy.c index 5712f7c5c..5c210c479 100644 --- a/src/common/gamecode/spy.c +++ b/src/common/gamecode/spy.c @@ -174,7 +174,7 @@ spy_cmd(unit * u, struct order * ord) int setwere_cmd(unit *u, struct order * ord) { -#ifdef KARMA_MODULE +#if KARMA_MODULE int level = fspecial(u->faction, FS_LYCANTROPE); const char *s; @@ -320,7 +320,7 @@ setstealth_cmd(unit * u, struct order * ord) /* TARNE ALLES (was nicht so alles geht?) */ u_seteffstealth(u, -1); break; -#ifdef KARMA_MODULE +#if KARMA_MODULE case P_NUMBER: /* TARNE ANZAHL [NICHT] */ if (!fspecial(u->faction, FS_HIDDEN)) { @@ -339,7 +339,7 @@ setstealth_cmd(unit * u, struct order * ord) } break; #endif /* KARMA_MODULE */ -#ifdef KARMA_MODULE +#if KARMA_MODULE case P_ITEMS: /* TARNE GEGENSTÄNDE [NICHT] */ if(!fspecial(u->faction, FS_HIDDEN)) { diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index 80cae678b..3b591f744 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -640,7 +640,7 @@ learn_cmd(unit * u, order * ord) change_effect(u, oldpotiontype[P_FOOL], -l); } - #ifdef KARMA_MODULE + #if KARMA_MODULE l = fspecial(u->faction, FS_WARRIOR); if (l > 0) { if (sk == SK_CROSSBOW || sk == SK_LONGBOW diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 1f8785ae8..f70a077c7 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -936,7 +936,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) ++at.fighter->hits; #endif -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fval(au, UFL_WERE)) { int level = fspecial(du->faction, FS_LYCANTROPE); da += level; @@ -974,7 +974,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) /* Momentan nur Trollgürtel und Werwolf-Eigenschaft */ am = select_magicarmor(dt); -#ifdef KARMA_MODULE +#if KARMA_MODULE if(fval(du, UFL_WERE)) { /* this counts as magical armor */ int level = fspecial(du->faction, FS_LYCANTROPE); @@ -982,8 +982,8 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) } #endif /* KARMA_MODULE */ -#if CHANGED_CROSSBOWS == 1 - if(awtype && fval(awtype,WTF_ARMORPIERCING)) { +#if CHANGED_CROSSBOWS + if (awtype && fval(awtype, WTF_ARMORPIERCING)) { /* crossbows */ ar /= 2; an /= 2; @@ -1001,7 +1001,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) if (type!=AT_COMBATSPELL && type!=AT_SPELL) { /* Kein Zauber, normaler Waffenschaden */ double kritchance = (sk * 3 - sd) / 200.0; -#ifdef KARMA_MODULE +#if KARMA_MODULE int faerie_level = fspecial(du->faction, FS_FAERIE); da += jihad(au->faction, du->race); @@ -1646,7 +1646,7 @@ skilldiff(troop at, troop dt, int dist) skdiff += 5; } -#ifdef KARMA_MODULE +#if KARMA_MODULE /* Werwolf */ if(fval(au, UFL_WERE)) { skdiff += fspecial(au->faction, FS_LYCANTROPE); @@ -1657,7 +1657,7 @@ skilldiff(troop at, troop dt, int dist) af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * 10) skdiff += 1; -#ifdef KARMA_MODULE +#if KARMA_MODULE /* TODO this should be a skillmod */ skdiff += jihad(au->faction, du->race); #endif @@ -1676,7 +1676,7 @@ skilldiff(troop at, troop dt, int dist) int beff = buildingeffsize(df->building, false)-1; /* -1 because the tradepost has no protection value */ -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(au->faction, FS_SAPPER)) { /* Halbe Schutzwirkung, aufgerundet */ beff = (beff+1)/2; @@ -2294,7 +2294,7 @@ aftermath(battle * b) unit *du = df->unit; int dead = dead_fighters(df); int pr_mercy = 0; -#ifdef KARMA_MODULE +#if KARMA_MODULE const attrib *a= a_find(du->attribs, &at_prayer_effect); while (a && a->type==&at_prayer_effect) { @@ -2951,7 +2951,7 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack) /* Effekte von Artefakten */ strongmen = min(fig->unit->number, get_item(u, I_TROLLBELT)); -#ifdef KARMA_MODULE +#if KARMA_MODULE for (a = a_find(u->attribs, &at_prayer_effect); a && a->type==&at_prayer_effect; a = a->next) { if (a->data.sa[0] == PR_AID) { pr_aid = true; @@ -4009,7 +4009,7 @@ do_battle(region * r) battle_update(b); battle_attacks(b); -#ifdef KARMA_MODULE +#if KARMA_MODULE /* Regeneration */ for (fi=0;fi!=b->nfighters;++fi) { fighter *fig = b->fighters[fi]; diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 11fd55c07..8d5ff5dfd 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -93,7 +93,7 @@ const struct race * new_race[MAXRACES]; boolean sqlpatch = false; int turn; -#ifdef XECMD_MODULE +#if XECMD_MODULE attrib_type at_xontormiaexpress = { "xontormiaexpress", DEFAULT_INIT, @@ -512,7 +512,7 @@ max_magicians(const faction * f) m = a->data.i; } if (f->race == new_race[RC_ELF]) ++m; -#ifdef KARMA_MODULE +#if KARMA_MODULE m += fspecial(f, FS_MAGOCRACY) * 2; #endif /* KARMA_MODULE */ return m; @@ -2318,7 +2318,7 @@ weight(const unit * u) in_bag += w; } -#ifdef KARMA_MODULE +#if KARMA_MODULE faerie_level = fspecial(u->faction, FS_FAERIE); #endif /* KARMA_MODULE */ @@ -2397,7 +2397,7 @@ lifestyle(const unit * u) if(u->region->planep && fval(u->region->planep, PFL_NOFEED)) return 0; -#ifdef KARMA_MODULE +#if KARMA_MODULE if(fspecial(u->faction, FS_REGENERATION)) need += 1; if(fspecial(u->faction, FS_ADMINISTRATOR)) @@ -2523,7 +2523,7 @@ default_wage(const region *r, const faction * f, const race * rc) index = 1; } wage = wagetable[esize][index]; -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(f, FS_URBAN)) { wage += wagetable[esize][3]; } @@ -2818,7 +2818,7 @@ attrib_init(void) at_register(&at_guard); at_register(&at_group); -#ifdef KARMA_MODULE +#if KARMA_MODULE at_register(&at_faction_special); at_register(&at_prayer_timeout); at_register(&at_wyrm); @@ -2838,7 +2838,7 @@ attrib_init(void) register_bordertype(&bt_questportal); at_register(&at_germs); -#ifdef XECMD_MODULE +#if XECMD_MODULE at_register(&at_xontormiaexpress); /* required for old datafiles */ #endif at_register(&at_speedup); diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 0a992e150..f57ba0c54 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -423,7 +423,7 @@ extern struct attrib_type at_guard; # define count_unit(u) 1 #endif -#ifdef XECMD_MODULE +#if XECMD_MODULE extern struct attrib_type at_xontormiaexpress; #endif diff --git a/src/common/kernel/faction.h b/src/common/kernel/faction.h index b9259dd1a..17d739356 100644 --- a/src/common/kernel/faction.h +++ b/src/common/kernel/faction.h @@ -89,10 +89,10 @@ typedef struct faction { boolean alive; /* enno: sollte ein flag werden */ int nregions; int money; -#ifdef SCORE_MODULE +#if SCORE_MODULE int score; #endif -#ifdef KARMA_MODULE +#if KARMA_MODULE int karma; #endif struct alliance * alliance; diff --git a/src/common/kernel/item.h b/src/common/kernel/item.h index cc7f0e0f5..e3a8a433a 100644 --- a/src/common/kernel/item.h +++ b/src/common/kernel/item.h @@ -128,7 +128,7 @@ typedef struct item_type { int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord); int (*useonother)(struct unit * user, int targetno, const struct item_type * itype, int amount, struct order * ord); int (*give)(struct unit * src, struct unit * dest, const struct item_type * itm, int number, struct order * ord); -#ifdef SCORE_MODULE +#if SCORE_MODULE int score; #endif struct item_type * next; diff --git a/src/common/kernel/karma.c b/src/common/kernel/karma.c index c94e2e05e..b3e388b65 100644 --- a/src/common/kernel/karma.c +++ b/src/common/kernel/karma.c @@ -69,7 +69,7 @@ attrib_type at_jihad = { "jihad", NULL, NULL, NULL, a_writeshorts, a_readshorts }; -#ifdef KARMA_MODULE +#if KARMA_MODULE struct fspecialdata fspecials[MAXFACTIONSPECIALS] = { { "Regeneration", diff --git a/src/common/kernel/karma.h b/src/common/kernel/karma.h index d98d7dc70..0122d0ba1 100644 --- a/src/common/kernel/karma.h +++ b/src/common/kernel/karma.h @@ -42,7 +42,7 @@ typedef enum { MAXFACTIONSPECIALS } fspecial_t; -#ifdef KARMA_MODULE +#if KARMA_MODULE typedef enum { PR_AID, PR_MERCY, diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index 5ed52e065..b88e43991 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -430,7 +430,7 @@ updatespelllist(unit * u) /* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */ sp = find_spellbyid(M_GRAU, SPL_BECOMEWYRM); -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=sk) { add_spell(mage, find_spellbyid(M_GRAU, SPL_BECOMEWYRM)); } @@ -1174,7 +1174,7 @@ target_resists_magic(unit *magician, void *obj, int objtyp, int t_bonus) skill * sv; unit * u = (unit*)obj; -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_MAGICIMMUNE)) return true; #endif /* KARMA_MODULE */ at = effskill(magician, SK_MAGIC); @@ -1406,7 +1406,7 @@ regeneration(unit * u) double potenz = 1.5; double divisor = 2.0; -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_MAGICIMMUNE)) return 0; #endif /* KARMA_MODULE */ diff --git a/src/common/kernel/move.c b/src/common/kernel/move.c index e4d18208b..f14472776 100644 --- a/src/common/kernel/move.c +++ b/src/common/kernel/move.c @@ -214,7 +214,7 @@ personcapacity(const unit *u) { int cap = u->race->weight+u->race->capacity; -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_QUICK)) cap -= 200; #endif /* KARMA_MODULE */ @@ -401,7 +401,7 @@ canswim(unit *u) if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4) return true; -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_AMPHIBIAN)) return true; #endif /* KARMA_MODULE */ if (u->race->flags & RCF_FLY) return true; @@ -1315,7 +1315,7 @@ movement_speed(unit * u) default: mp = BP_WALKING; -#ifdef KARMA_MODULE +#if KARMA_MODULE /* faction special */ if (fspecial(u->faction, FS_QUICK)) mp = BP_RIDING; #endif /* KARMA_MODULE */ diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index c786cdb3a..8c96d99a6 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -204,7 +204,7 @@ unit_max_hp(const unit * u) p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2; h += (int) (h * p + 0.5); -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_UNDEAD)) { h *= 2; } diff --git a/src/common/kernel/reports.c b/src/common/kernel/reports.c index 2f498f662..042a895f2 100644 --- a/src/common/kernel/reports.c +++ b/src/common/kernel/reports.c @@ -267,7 +267,7 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char * buf, siz itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct)); } -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_HIDDEN)) { a_fshidden = a_find(u->attribs, &at_fshidden); } diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 5e0b6eb89..e46ca881e 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1404,7 +1404,7 @@ readfaction(FILE * F, int encoding) } f->magiegebiet = (magic_t)ri(F); -#ifdef KARMA_MODULE +#if KARMA_MODULE f->karma = ri(F); #else /* ignore karma */ @@ -1491,7 +1491,7 @@ writefaction(FILE * F, const faction * f) ws(F, f->race->_name[0]); wnl(F); wi(F, f->magiegebiet); -#ifdef KARMA_MODULE +#if KARMA_MODULE wi(F, f->karma); #else wi(F, 0); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 936686eb1..5a3e1473a 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -1156,7 +1156,7 @@ get_modifier(const unit *u, skill_t sk, int level, const region *r, boolean noit } skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS); -#ifdef KARMA_MODULE +#if KARMA_MODULE if (fspecial(u->faction, FS_TELEPATHY)) { switch(sk) { case SK_ALCHEMY: diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index af4b9a302..027b7811c 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -767,7 +767,7 @@ xml_readitem(xmlXPathContextPtr xpath, resource_type * rtype) if (xml_bvalue(node, "animal", false)) flags |= ITF_ANIMAL; if (xml_bvalue(node, "vehicle", false)) flags |= ITF_VEHICLE; itype = new_itemtype(rtype, flags, weight, capacity); -#ifdef SCORE_MODULE +#if SCORE_MODULE itype->score = xml_ivalue(node, "score", 0); #endif diff --git a/src/common/modules/arena.c b/src/common/modules/arena.c index b4b2ba177..8c0a4d4b5 100644 --- a/src/common/modules/arena.c +++ b/src/common/modules/arena.c @@ -15,7 +15,7 @@ #include #include -#ifdef ARENA_MODULE +#if ARENA_MODULE #include "arena.h" /* modules include */ diff --git a/src/common/modules/arena.h b/src/common/modules/arena.h index 906e9ae5a..fb55e3ae7 100644 --- a/src/common/modules/arena.h +++ b/src/common/modules/arena.h @@ -18,7 +18,7 @@ extern "C" { #endif -#ifndef ARENA_MODULE +#if ARENA_MODULE == 0 #error "must define ARENA_MODULE to use this module" #endif /* exports: */ diff --git a/src/common/modules/dungeon.c b/src/common/modules/dungeon.c index 8d4ea4842..5121a67de 100644 --- a/src/common/modules/dungeon.c +++ b/src/common/modules/dungeon.c @@ -13,7 +13,7 @@ #include #include -#ifdef DUNGEON_MODULE +#if DUNGEON_MODULE #include "dungeon.h" #include "gmcmd.h" diff --git a/src/common/modules/dungeon.h b/src/common/modules/dungeon.h index 5ad8c03d5..b0526e5a9 100644 --- a/src/common/modules/dungeon.h +++ b/src/common/modules/dungeon.h @@ -16,7 +16,7 @@ extern "C" { #endif -#ifndef DUNGEON_MODULE +#if DUNGEON_MODULE == 0 #error "must define DUNGEON_MODULE to use this module" #endif diff --git a/src/common/modules/infocmd.c b/src/common/modules/infocmd.c index b86ae6615..4d5da45fa 100644 --- a/src/common/modules/infocmd.c +++ b/src/common/modules/infocmd.c @@ -13,7 +13,7 @@ #include #include -#ifdef INFOCMD_MODULE +#if INFOCMD_MODULE #include "infocmd.h" #include "command.h" diff --git a/src/common/modules/infocmd.h b/src/common/modules/infocmd.h index c0375de57..f22929795 100644 --- a/src/common/modules/infocmd.h +++ b/src/common/modules/infocmd.h @@ -16,7 +16,7 @@ extern "C" { #endif -#ifdef INFOCMD_MODULE +#if INFOCMD_MODULE extern void init_info(void); extern void infocommands(void); #endif diff --git a/src/common/modules/museum.c b/src/common/modules/museum.c index 804c5dde1..34245f319 100644 --- a/src/common/modules/museum.c +++ b/src/common/modules/museum.c @@ -21,7 +21,7 @@ #include #include -#ifdef MUSEUM_MODULE +#if MUSEUM_MODULE #include "museum.h" /* kernel includes */ diff --git a/src/common/modules/museum.h b/src/common/modules/museum.h index 916be9078..5f94e53d6 100644 --- a/src/common/modules/museum.h +++ b/src/common/modules/museum.h @@ -18,7 +18,7 @@ extern "C" { #endif -#ifndef MUSEUM_MODULE +#if MUSEUM_MODULE == 0 #error "must define MUSEUM_MODULE to use this module" #endif diff --git a/src/common/modules/score.c b/src/common/modules/score.c index 28d19c465..364669162 100644 --- a/src/common/modules/score.c +++ b/src/common/modules/score.c @@ -21,7 +21,7 @@ #include #include -#ifdef SCORE_MODULE +#if SCORE_MODULE #include "score.h" /* kernel includes */ diff --git a/src/common/modules/score.h b/src/common/modules/score.h index 58488377a..1a2da8f69 100644 --- a/src/common/modules/score.h +++ b/src/common/modules/score.h @@ -25,7 +25,7 @@ extern "C" { #endif -#ifndef SCORE_MODULE +#if SCORE_MODULE == 0 #error "must define SCORE_MODULE to use this module" #endif diff --git a/src/common/modules/wormhole.c b/src/common/modules/wormhole.c index cb0ccf83f..5b39f5d27 100644 --- a/src/common/modules/wormhole.c +++ b/src/common/modules/wormhole.c @@ -13,7 +13,7 @@ #include #include -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE #include "wormhole.h" /* kernel includes */ diff --git a/src/common/modules/wormhole.h b/src/common/modules/wormhole.h index 50325a00c..cc2322aa4 100644 --- a/src/common/modules/wormhole.h +++ b/src/common/modules/wormhole.h @@ -17,7 +17,7 @@ extern "C" { #endif -#ifndef WORMHOLE_MODULE +#if WORMHOLE_MODULE == 0 #error "must define WORMHOLE_MODULE to use this module" #endif diff --git a/src/common/modules/xecmd.c b/src/common/modules/xecmd.c index f82770c1b..171c1050e 100644 --- a/src/common/modules/xecmd.c +++ b/src/common/modules/xecmd.c @@ -13,7 +13,7 @@ #include #include -#ifdef XECMD_MODULE +#if XECMD_MODULE #include "xecmd.h" #include diff --git a/src/common/modules/xecmd.h b/src/common/modules/xecmd.h index 7fb81ae03..a964d38da 100644 --- a/src/common/modules/xecmd.h +++ b/src/common/modules/xecmd.h @@ -16,7 +16,7 @@ extern "C" { #endif -#ifdef XECMD_MODULE +#if XECMD_MODULE int xecmd(struct unit * u, struct order * ord); #endif diff --git a/src/common/settings-eressea.h b/src/common/settings-eressea.h index aaf2486b8..8c97eab6e 100644 --- a/src/common/settings-eressea.h +++ b/src/common/settings-eressea.h @@ -38,11 +38,20 @@ #define ROW_FACTOR 3 /* factor for combat row advancement rule */ #define HEROES -#define SCORE_MODULE -#define MUSEUM_MODULE -#define ARENA_MODULE -#define WORMHOLE_MODULE -#define XECMD_MODULE +/* optional game components. TODO: These should either be + * configuration variables (XML), script extensions (lua), + * or both. We don't want separate binaries for different games + */ +#define SCORE_MODULE 1 +#define MUSEUM_MODULE 1 +#define ARENA_MODULE 1 +#define WORMHOLE_MODULE 1 +#define XECMD_MODULE 1 +#define KARMA_MODULE 0 +#define DUNGEON_MODULE 0 +#define INFOCMD_MODULE 0 +#define CHANGED_CROSSBOWS 0 /* use the WTF_ARMORPIERCING flag */ +#define GLOBAL_WARMING 200 /* number of turns before global warming sets in */ #define SIMPLE_COMBAT #define SIMPLE_ESCAPE diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 1d492636c..0bd54039b 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -6799,7 +6799,7 @@ sp_break_curse(castorder *co) int sp_becomewyrm(castorder *co) { -#ifdef KARMA_MODULE +#if KARMA_MODULE unit *u = co->magician.u; int wyrms_already_created = 0; int wyrms_allowed = 0; diff --git a/src/eressea/gmtool.c b/src/eressea/gmtool.c index 1118eae7b..956244818 100644 --- a/src/eressea/gmtool.c +++ b/src/eressea/gmtool.c @@ -21,16 +21,16 @@ #include #include -#ifdef MUSEUM_MODULE +#if MUSEUM_MODULE #include #endif -#ifdef ARENA_MODULE +#if ARENA_MODULE #include #endif -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE #include #endif -#ifdef DUNGEON_MODULE +#if DUNGEON_MODULE #include #endif diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 65a00509a..3c67b36de 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -605,9 +605,7 @@ frame_regions(void) } } -#define GLOBAL_WARMING 200 - -#ifdef GLOBAL_WARMING +#if GLOBAL_WARMING static void iceberg(region * r) @@ -994,16 +992,13 @@ korrektur(void) { check_dissolve(); french_testers(); -#if TEST_LOCALES - setup_locales(); -#endif do_once("rdec", &road_decay); do_once("unfi", &fix_undead); do_once("chgt", &fix_chaosgates); do_once("atrx", &fix_attribflags); do_once("asfi", &fix_astral_firewalls); frame_regions(); -#ifdef GLOBAL_WARMING +#if GLOBAL_WARMING if (get_gamedate(turn, NULL)->season == SEASON_SUMMER) { global_warming(); } diff --git a/src/eressea/server.cpp b/src/eressea/server.cpp index 3453e2be3..41de21ca8 100644 --- a/src/eressea/server.cpp +++ b/src/eressea/server.cpp @@ -43,16 +43,16 @@ #include #include #include -#ifdef MUSEUM_MODULE +#if MUSEUM_MODULE #include #endif -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE #include #endif -#ifdef ARENA_MODULE +#if ARENA_MODULE #include #endif -#ifdef DUNGEON_MODULE +#if DUNGEON_MODULE #include #endif @@ -235,16 +235,16 @@ game_init(void) register_itemfunctions(); register_spells(); register_gcspells(); -#ifdef DUNGEON_MODULE +#if DUNGEON_MODULE register_dungeon(); #endif -#ifdef MUSEUM_MODULE +#if MUSEUM_MODULE register_museum(); #endif -#ifdef ARENA_MODULE +#if ARENA_MODULE register_arena(); #endif -#ifdef WORMHOLE_MODULE +#if WORMHOLE_MODULE register_wormholes(); #endif @@ -262,7 +262,7 @@ game_init(void) init_rawmaterials(); init_gmcmd(); -#ifdef INFOCMD_MODULE +#if INFOCMD_MODULE init_info(); #endif }