fix NOTLOST items lost in battle

This commit is contained in:
Steffen Mecke 2018-09-12 09:41:18 +02:00 committed by Enno Rehling
parent 6a9cea219c
commit 5455037dbc
1 changed files with 15 additions and 18 deletions

View File

@ -1130,19 +1130,16 @@ static void destroy_items(troop dt) {
for (pitm = &du->items; *pitm;) { for (pitm = &du->items; *pitm;) {
item *itm = *pitm; item *itm = *pitm;
const item_type *itype = itm->type; const item_type *itype = itm->type;
if (!(itype->flags & ITF_CURSED) && dt.index < itm->number) { if (!(itype->flags & (ITF_CURSED | ITF_NOTLOST)) && dt.index < itm->number) {
/* 25% Grundchance, das ein Item kaputtgeht. */ /* 25% Grundchance, dass ein Item kaputtgeht. */
if (rng_int() % 4 < 1) { if (rng_int() % 4 < 1) {
i_change(pitm, itype, -1); i_change(pitm, itype, -1);
} }
}
if (*pitm == itm) { if (*pitm == itm) {
pitm = &itm->next; pitm = &itm->next;
} }
} }
else {
pitm = &itm->next;
}
}
} }
static void calculate_defense_type(troop at, troop dt, int type, bool missile, static void calculate_defense_type(troop at, troop dt, int type, bool missile,