From 4bd295e3b283c6dae43ca593ecf8af8fd4e7f1d6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 20 Feb 2017 20:42:31 +0100 Subject: [PATCH] remove the nearly unused illusion race --- res/core/messages.xml | 14 -------------- res/e3a/races.xml | 7 ------- res/eressea/races.xml | 6 ------ src/kernel/race.c | 15 +++++++++++---- src/kernel/race.h | 4 ++-- src/races/CMakeLists.txt | 1 - src/races/illusion.c | 38 -------------------------------------- src/races/races.c | 2 -- src/reports.c | 5 ++--- 9 files changed, 15 insertions(+), 77 deletions(-) delete mode 100644 src/races/illusion.c diff --git a/res/core/messages.xml b/res/core/messages.xml index 3fae49eb3..e312fcc7c 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -3266,20 +3266,6 @@ "$unit($unit) marschiert in eine Antimagiezone und löst sich auf." "$unit($unit) walks into an antimagical zone and dissolves." - - - - - "$unit($unit) hat sich unbemerkt verflüchtigt." - "$unit($unit) has dissolved without a trace." - - - - - - "$unit($unit) wird sich bald verflüchtigen." - "$unit($unit) will dissolve soon." - diff --git a/res/e3a/races.xml b/res/e3a/races.xml index e81d31b92..83d356f75 100644 --- a/res/e3a/races.xml +++ b/res/e3a/races.xml @@ -696,13 +696,6 @@ - - - - - - - diff --git a/res/eressea/races.xml b/res/eressea/races.xml index 470a33a3f..bce464d78 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -745,12 +745,6 @@ - - - - - - diff --git a/src/kernel/race.c b/src/kernel/race.c index e3983bffe..56b0590ae 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -66,7 +66,7 @@ static int rc_changes = 1; static const char *racenames[MAXRACES] = { "dwarf", "elf", NULL, "goblin", "human", "troll", "demon", "insect", - "halfling", "cat", "aquarian", "orc", "snotling", "undead", "illusion", + "halfling", "cat", "aquarian", "orc", "snotling", "undead", NULL, "youngdragon", "dragon", "wyrm", "ent", "catdragon", "dracoid", NULL, "spell", "irongolem", "stonegolem", "shadowdemon", "shadowmaster", "mountainguard", "alp", "toad", "braineater", "peasant", @@ -296,9 +296,16 @@ static race *rc_find_i(const char *name) while (rc && strcmp(rname, rc->_name) != 0) { rc = rc->next; } - if (!rc && strcmp(name, "uruk") == 0) { - rc = rc_find_i("orc"); - log_warning("a reference was made to the retired race '%s', returning '%s'.", name, rc->_name); + if (!rc) { + const char *rc_depr[] = { "uruk", "orc", "illusion", "template", NULL }; + int i; + for (i = 0; rc_depr[i]; i += 2) { + if (strcmp(name, rc_depr[i]) == 0) { + rc = rc_find_i(rc_depr[i + 1]); + log_warning("a reference was made to the retired race '%s', returning '%s'.", name, rc->_name); + break; + } + } } return rc; } diff --git a/src/kernel/race.h b/src/kernel/race.h index 1322d3aad..1039402b0 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -65,8 +65,8 @@ extern "C" { RC_ORC, RC_SNOTLING, RC_UNDEAD, - RC_ILLUSION, - RC_FIREDRAGON, + + RC_FIREDRAGON = 15, RC_DRAGON, RC_WYRM, RC_TREEMAN, diff --git a/src/races/CMakeLists.txt b/src/races/CMakeLists.txt index 1f3044e3a..ff6025581 100644 --- a/src/races/CMakeLists.txt +++ b/src/races/CMakeLists.txt @@ -1,7 +1,6 @@ PROJECT(races C) SET(_FILES dragons.c -illusion.c races.c zombies.c ) diff --git a/src/races/illusion.c b/src/races/illusion.c deleted file mode 100644 index 7411ae4d5..000000000 --- a/src/races/illusion.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Eressea PB(E)M host Copyright (C) 1998-2015 - * Christian Schlittchen (corwin@amber.kn-bremen.de) - * Katja Zedel (katze@felidae.kn-bremen.de) - * Henning Peters (faroul@beyond.kn-bremen.de) - * Enno Rehling (enno@eressea.de) - * Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de) - * - * This program may not be used, modified or distributed without - * prior permission by the authors of Eressea. - */ - -#include - -/* kernel includes */ -#include -#include -#include -#include - -/* libc includes */ -#include -#include - -#define ILLUSIONMAX 6 - -void age_illusion(unit * u) -{ - if (u->faction->race != get_race(RC_ILLUSION)) { - if (u->age == ILLUSIONMAX) { - ADDMSG(&u->faction->msgs, msg_message("warnillusiondissolve", "unit", u)); - } - else if (u->age > ILLUSIONMAX) { - set_number(u, 0); - ADDMSG(&u->faction->msgs, msg_message("illusiondissolve", "unit", u)); - } - } -} diff --git a/src/races/races.c b/src/races/races.c index bb699520e..7ca9e976a 100644 --- a/src/races/races.c +++ b/src/races/races.c @@ -31,7 +31,6 @@ void age_firedragon(struct unit *u); void age_dragon(struct unit *u); -void age_illusion(struct unit *u); void age_undead(struct unit *u); void age_skeleton(struct unit *u); void age_zombie(struct unit *u); @@ -101,7 +100,6 @@ void register_races(void) /* function age for race->age() */ register_function((pf_generic)age_undead, "ageundead"); - register_function((pf_generic)age_illusion, "ageillusion"); register_function((pf_generic)age_skeleton, "ageskeleton"); register_function((pf_generic)age_zombie, "agezombie"); register_function((pf_generic)age_ghoul, "ageghoul"); diff --git a/src/reports.c b/src/reports.c index 7d8374ff5..a49957b9d 100644 --- a/src/reports.c +++ b/src/reports.c @@ -123,13 +123,12 @@ const char *options[MAXOPTIONS] = { bool omniscient(const faction *f) { - static const race *rc_template, *rc_illusion; + static const race *rc_template; static int cache; if (rc_changed(&cache)) { - rc_illusion = get_race(RC_ILLUSION); rc_template = get_race(RC_TEMPLATE); } - return (f->race == rc_template || f->race == rc_illusion); + return (f->race == rc_template); }