diff --git a/src/battle.c b/src/battle.c index 8c1627d97..fe61c8adf 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1123,26 +1123,23 @@ static bool survives(fighter *af, troop dt, battle *b) { } static void destroy_items(troop dt) { - unit *du = dt.fighter->unit; + unit *du = dt.fighter->unit; - item **pitm; + item **pitm; - for (pitm = &du->items; *pitm;) { - item *itm = *pitm; - const item_type *itype = itm->type; - if (!(itype->flags & ITF_CURSED) && dt.index < itm->number) { - /* 25% Grundchance, das ein Item kaputtgeht. */ - if (rng_int() % 4 < 1) { - i_change(pitm, itype, -1); - } - if (*pitm == itm) { - pitm = &itm->next; - } - } - else { - pitm = &itm->next; - } - } + for (pitm = &du->items; *pitm;) { + item *itm = *pitm; + const item_type *itype = itm->type; + if (!(itype->flags & (ITF_CURSED | ITF_NOTLOST)) && dt.index < itm->number) { + /* 25% Grundchance, dass ein Item kaputtgeht. */ + if (rng_int() % 4 < 1) { + i_change(pitm, itype, -1); + } + } + if (*pitm == itm) { + pitm = &itm->next; + } + } } static void calculate_defense_type(troop at, troop dt, int type, bool missile,