add some TODO and reduce old_race usage.

This commit is contained in:
Enno Rehling 2016-09-19 18:45:16 +02:00
parent a7fbe4901b
commit aceb880826
2 changed files with 3 additions and 7 deletions

View file

@ -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) static double heal_factor(const unit * u)
{ {
double elf_regen; double elf_regen;
// TODO: do not hard-code, make this a property, race.healing
switch (old_race(u_race(u))) { switch (old_race(u_race(u))) {
case RC_TROLL: case RC_TROLL:
case RC_DAEMON: case RC_DAEMON:

View file

@ -83,6 +83,7 @@ static void eaten_by_monster(unit * u)
multi = RESOURCE_QUANTITY * newterrain(T_PLAIN)->size / 10000.0; 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))) { switch (old_race(u_race(u))) {
case RC_FIREDRAGON: case RC_FIREDRAGON:
n = rng_int() % 80 * u->number; n = rng_int() % 80 * u->number;
@ -118,12 +119,7 @@ static void eaten_by_monster(unit * u)
static void absorbed_by_monster(unit * u) static void absorbed_by_monster(unit * u)
{ {
int n; int n = rng_int() % (u->number / 20 + 1);
switch (old_race(u_race(u))) {
default:
n = rng_int() % (u->number / 20 + 1);
}
if (n > 0) { if (n > 0) {
n = lovar(n); n = lovar(n);