From e4d411a0930e69cbe465ec243653de52ded36eb8 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sun, 6 Oct 2002 09:16:34 +0000 Subject: [PATCH] - Monster brauchen keinen Unterhalt mehr. --- src/common/gamecode/laws.c | 6 ------ src/common/kernel/eressea.c | 6 +++++- src/common/kernel/unit.c | 7 +++++++ src/common/kernel/unit.h | 2 ++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 054aefd09..7ffdebd81 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -143,12 +143,6 @@ checkorders(void) } /* ------------------------------------------------------------- */ -static boolean -is_monstrous(unit * u) -{ - return (boolean) (u->faction->no == MONSTER_FACTION || !playerrace(u->race)); -} - static void get_food(region *r) { diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index b1254ca49..93486e78f 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2579,7 +2579,11 @@ int lifestyle(const unit * u) { static plane * astralspace = NULL; - int need = u->number * u->race->maintenance; + int need; + + if(is_monstrous(u)) return 0; + + need = u->number * u->race->maintenance; if (!astralspace) { astralspace = getplanebyname("Astralraum"); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 18ad842f3..4ec012f44 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -1048,3 +1048,10 @@ invisible(const unit *u) return get_item(u, I_RING_OF_INVISIBILITY) + 100 * get_item(u, I_SPHERE_OF_INVISIBILITY); } + +boolean +is_monstrous(const unit * u) +{ + return (boolean) (u->faction->no == MONSTER_FACTION || !playerrace(u->race)); +} + diff --git a/src/common/kernel/unit.h b/src/common/kernel/unit.h index 2b47c93c7..dbe45e0c8 100644 --- a/src/common/kernel/unit.h +++ b/src/common/kernel/unit.h @@ -154,4 +154,6 @@ extern boolean learn_skill(struct unit * u, skill_t sk, double chance); extern int invisible(const unit *u); +extern boolean is_monstrous(const unit * u); + #endif