Skip to content

Commit

Permalink
Heiltrank und Heilzauber: Heilt keine temporären Kämpfer (Wölfe)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennorehling committed Jun 10, 2024
1 parent b4d7ace commit a325fa2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,16 @@ static bool resurrect_troop(troop dt)
{
fighter *df = dt.fighter;
unit *du = df->unit;
if (oldpotiontype[P_HEAL] && !fval(&df->person[dt.index], FL_HEALING_USED)) {
if (i_get(du->items, oldpotiontype[P_HEAL]) > 0) {
fset(&df->person[dt.index], FL_HEALING_USED);
i_change(&du->items, oldpotiontype[P_HEAL], -1);
df->person[dt.index].hp = u_race(du)->hitpoints * 5; /* give the person a buffer */
return true;

/* do not heal temporary fighters */
if (!a_find(du->attribs, &at_unitdissolve)) {
if (oldpotiontype[P_HEAL] && !fval(&df->person[dt.index], FL_HEALING_USED)) {
if (i_get(du->items, oldpotiontype[P_HEAL]) > 0) {
fset(&df->person[dt.index], FL_HEALING_USED);
i_change(&du->items, oldpotiontype[P_HEAL], -1);
df->person[dt.index].hp = u_race(du)->hitpoints * 5; /* give the person a buffer */
return true;
}
}
}
return false;
Expand Down
6 changes: 5 additions & 1 deletion src/spells/combatspells.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,10 +1392,14 @@ static int heal_fighters(selist * fgs, int *power, bool heal_monsters)

for (qi = 0, ql = fgs; ql; selist_advance(&ql, &qi, 1)) {
fighter *df = (fighter *)selist_get(ql, qi);

if (healhp <= 0)
break;

/* do not heal temporary fighters */
if (a_find(df->unit->attribs, &at_unitdissolve)) {
continue;
}

/* Untote kann man nicht heilen */
if (df->unit->number == 0 || (u_race(df->unit)->flags & RCF_NOHEAL))
continue;
Expand Down

0 comments on commit a325fa2

Please sign in to comment.