From 6eaca764fec49cc41b43303f8819081be715445c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 15 Oct 2006 12:05:07 +0000 Subject: [PATCH] division by zero wegen post-kampfzaubern, die die unit->number veraendern. --- src/common/kernel/battle.c | 2 +- src/common/spells/combatspells.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index bcef511ad..dce9f8a28 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -2929,7 +2929,7 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack) } /* Illusionen und Zauber kaempfen nicht */ - if (fval(u->race, RCF_ILLUSIONARY) || idle(u->faction)) + if (fval(u->race, RCF_ILLUSIONARY) || idle(u->faction) || u->number==0) return NULL; if (s1==NULL) { diff --git a/src/common/spells/combatspells.c b/src/common/spells/combatspells.c index 7cbc581bd..96b611e63 100644 --- a/src/common/spells/combatspells.c +++ b/src/common/spells/combatspells.c @@ -1561,7 +1561,7 @@ heal_fighters(cvector *fgs, int * power, boolean heal_monsters) if (healhp<=0) break; /* Untote kann man nicht heilen */ - if (fval(df->unit->race, RCF_NOHEAL)) continue; + if (df->unit->number==0 || fval(df->unit->race, RCF_NOHEAL)) continue; /* wir heilen erstmal keine Monster */ if (heal_monsters || playerrace(df->unit->race)) {