forked from github/server
fix NOTLOST items lost in battle
This commit is contained in:
parent
6a9cea219c
commit
5455037dbc
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue