From 14a1cb1acc5c11d53a2e98ee292e6d50cc3d66f5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 20 Feb 2010 18:55:42 +0000 Subject: [PATCH] first changes from hg_eressea transferred --- src/common/kernel/eressea.c | 11 +++++++++-- src/common/kernel/eressea.h | 1 + src/common/kernel/unit.c | 4 ++++ src/common/spells/regioncurse.c | 9 --------- src/common/spells/regioncurse.h | 1 - 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index d53fa0c5b..c8fc7f8e8 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -53,8 +53,6 @@ #include "terrain.h" #include "unit.h" -#include - /* util includes */ #include #include @@ -2727,6 +2725,15 @@ int rule_auto_taxation(void) return rule_taxation; } +int rule_blessed_harvest(void) +{ + static int rule = -1; + if (rule<0) { + rule = get_param_int(global.parameters, "rules.magic.blessed_harvest", HARVEST_WORK); + } + return rule; +} + static int default_wage(const region *r, const faction * f, const race * rc, int in_turn) { diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index c3cc02c39..618f7bb90 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -255,6 +255,7 @@ int cmp_current_owner(const struct building * b, const struct building * bother) int rule_auto_taxation(void); int rule_region_owners(void); int rule_stealth_faction(void); +int rule_blessed_harvest(void); extern int count_all(const struct faction * f); extern int count_migrants (const struct faction * f); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 093037159..133965f82 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -900,8 +900,12 @@ move_unit(unit * u, region * r, unit ** ulist) fset(u, UFL_MOVED); if (u->ship || u->building) { /* can_leave must be checked in travel_i */ +#ifndef NDEBUG boolean result = leave(u, false); assert(result); +#else + leave(u, false); +#endif } translist(&u->region->units, ulist, u); } else { diff --git a/src/common/spells/regioncurse.c b/src/common/spells/regioncurse.c index b05d70e90..b02af0181 100644 --- a/src/common/spells/regioncurse.c +++ b/src/common/spells/regioncurse.c @@ -203,15 +203,6 @@ static struct curse_type ct_blessedharvest = { cinfo_simple }; -int rule_blessed_harvest(void) -{ - static int rule = -1; - if (rule<0) { - rule = get_param_int(global.parameters, "rules.magic.blessed_harvest", HARVEST_WORK); - } - return rule; -} - static struct curse_type ct_drought = { "drought", CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ), diff --git a/src/common/spells/regioncurse.h b/src/common/spells/regioncurse.h index 46b32872c..d91f4847b 100644 --- a/src/common/spells/regioncurse.h +++ b/src/common/spells/regioncurse.h @@ -24,7 +24,6 @@ extern void register_regioncurse(void); #define HARVEST_WORK 0x00 #define HARVEST_TAXES 0x01 -int rule_blessed_harvest(void); #ifdef __cplusplus }