From aceb8808268611c6445a3896778c51b455089819 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 19 Sep 2016 18:45:16 +0200 Subject: [PATCH] add some TODO and reduce old_race usage. --- src/laws.c | 2 +- src/monster.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/laws.c b/src/laws.c index 19078353e..199d9e0a0 100755 --- a/src/laws.c +++ b/src/laws.c @@ -3464,7 +3464,7 @@ static int use_item(unit * u, const item_type * itype, int amount, struct order static double heal_factor(const unit * u) { double elf_regen; - + // TODO: do not hard-code, make this a property, race.healing switch (old_race(u_race(u))) { case RC_TROLL: case RC_DAEMON: diff --git a/src/monster.c b/src/monster.c index 5eafba1ea..37c48f8b5 100644 --- a/src/monster.c +++ b/src/monster.c @@ -83,6 +83,7 @@ static void eaten_by_monster(unit * u) multi = RESOURCE_QUANTITY * newterrain(T_PLAIN)->size / 10000.0; } + // TODO: do not hard-code, make it a race property or callback? it's already RCF_KILLPEASANTS switch (old_race(u_race(u))) { case RC_FIREDRAGON: n = rng_int() % 80 * u->number; @@ -118,12 +119,7 @@ static void eaten_by_monster(unit * u) static void absorbed_by_monster(unit * u) { - int n; - - switch (old_race(u_race(u))) { - default: - n = rng_int() % (u->number / 20 + 1); - } + int n = rng_int() % (u->number / 20 + 1); if (n > 0) { n = lovar(n);