From e5ce17b6efea9c8b6f05c10cf1a09baeb9fa699b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 7 Jan 2008 20:43:16 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D13?= =?UTF-8?q?41=20"Draigzauber=20M=C3=A4chte=20des=20Todes=20ruft=20Skelette?= =?UTF-8?q?=20mit=20Talent=20Magie"=20added=20a=20one-time=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eressea/korrektur.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 3daf08ada..8f9e0126f 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -469,6 +469,43 @@ typedef struct gate_data { struct region * target; } gate_data; +static int +fix_undead(void) +{ + region * r; + for (r=regions;r;r=r->next) { + unit * u; + for (u=r->units;u;u=u->next) { + if (u->race!=u->faction->race && u->skill_size>20) { + skill * sm = get_skill(u, SK_MAGIC); + skill * sa = get_skill(u, SK_HERBALISM); + + if (sm && sa) { + int level = sm->level; + attrib * a = a_find(u->attribs, &at_mage); + if (a) { + a_remove(&u->attribs, a); + } + free(u->skills); + u->skills = 0; + u->skill_size = 0; + + if (level>0) { + const race * rc = u->race; + skill_t sk; + for (sk=0;sk!=MAXSKILLS;++sk) { + if (rc->bonus[sk]>0) { + set_level(u, sk, level); + } + } + } + } + } + } + } + return 0; +} + static void fix_gates(void) { @@ -926,7 +963,7 @@ korrektur(void) 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);