From c5421f9a1fb1da5f92db6d138e68cfc337325535 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 13 Feb 2004 19:14:38 +0000 Subject: [PATCH] =?UTF-8?q?Golems=20k=C3=B6nnen=20nicht=20mehr=20=C3=BCber?= =?UTF-8?q?geben=20werden=20Fix=20f=C3=BCr=20Rassen,=20sie=20ein=20at=5Fun?= =?UTF-8?q?itdissolve=20haben=20sollten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eressea/korrektur.c | 73 ++++++++++++++++++++++++----------------- src/res/races.xml | 4 +-- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 65ba9b113..4f0b59b12 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -80,9 +80,9 @@ #include #include -#undef XMAS1999 -#undef XMAS2000 -#undef XMAS2001 +#undef XMAS1999 +#undef XMAS2000 +#undef XMAS2001 #undef XMAS2002 extern void reorder_owners(struct region * r); @@ -1161,9 +1161,48 @@ check_phoenix(void) } #endif +static void +fix_dissolve(unit * u, int value, char mode) +{ + attrib * a = a_find(u->attribs, &at_unitdissolve); + if (a!=NULL) return; + a = a_add(&u->attribs, a_new(&at_unitdissolve)); + a->data.ca[0] = mode; + a->data.ca[1] = (char)value; + log_warning(("unit %s has race %s and no dissolve-attrib\n", unitname(u), rc_name(u->race, 0))); +} + +static void +check_dissolve(void) +{ + region * r; + for (r=regions;r!=NULL;r=r->next) { + unit * u; + for (u=r->units;u!=NULL;u=u->next) { + if (u->race==new_race[RC_STONEGOLEM]) { + fix_dissolve(u, STONEGOLEM_CRUMBLE, 0); + continue; + } + if (u->race==new_race[RC_IRONGOLEM]) { + fix_dissolve(u, IRONGOLEM_CRUMBLE, 0); + continue; + } + if (u->race==new_race[RC_PEASANT]) { + fix_dissolve(u, 15, 1); + continue; + } + if (u->race==new_race[RC_TREEMAN]) { + fix_dissolve(u, 5, 2); + continue; + } + } + } +} + void korrektur(void) { + check_dissolve(); french_testers(); #if TEST_LOCALES setup_locales(); @@ -1171,9 +1210,6 @@ korrektur(void) fix_astralplane(); fix_firewalls(); fix_gates(); -#ifdef TEST_GM_COMMANDS - setup_gm_faction(); -#endif update_gms(); verify_owners(false); /* fix_herbtypes(); */ @@ -1213,36 +1249,11 @@ korrektur(void) #endif if (global.data_versionnext) { - unit * u; - if (rplane(r)!=astralplane) continue; - for (u=r->units;u;u=u->next) freset(u->faction, FL_DH); - for (u=r->units;u;u=u->next) { - if (u->faction->no==MONSTER_FACTION) continue; - if (!fval(u->faction, FL_DH)) { - fset(u->faction, FL_DH); - i_change(&u->items, itype, 300); - } - } - } - return 0; -} - void korrektur_end(void) { diff --git a/src/res/races.xml b/src/res/races.xml index 1e569d894..9dba5adee 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -627,13 +627,13 @@ - + - +