diff --git a/src/common/races/zombies.c b/src/common/races/zombies.c index 8d71aae99..eb5c636c9 100644 --- a/src/common/races/zombies.c +++ b/src/common/races/zombies.c @@ -84,7 +84,7 @@ void age_skeleton(unit *u) { if (u->faction->no == 0 && rand()%100 < age_chance(u->age, 27, 1)) { - int n = (u->number+1)/2; + int n = max(1,u->number/2); double q = (double) u->hp / (double) (unit_max_hp(u) * u->number); u->race = new_race[RC_SKELETON_LORD]; u->irace = new_race[RC_SKELETON_LORD]; @@ -97,7 +97,7 @@ void age_zombie(unit *u) { if (u->faction->no == 0 && rand()%100 < age_chance(u->age, 27, 1)) { - int n = (u->number+1)/2; + int n = max(1,u->number/2); double q = (double) u->hp / (double) (unit_max_hp(u) * u->number); u->race = new_race[RC_ZOMBIE_LORD]; u->irace = new_race[RC_ZOMBIE_LORD]; @@ -110,7 +110,7 @@ void age_ghoul(unit *u) { if (u->faction->no == 0 && rand()%100 < age_chance(u->age, 27, 1)) { - int n = (u->number+1)/2; + int n = max(1,u->number/2); double q = (double) u->hp / (double) (unit_max_hp(u) * u->number); u->race = new_race[RC_GHOUL_LORD]; u->irace = new_race[RC_GHOUL_LORD];