fixed a possible crash after killing 400 mutants

This commit is contained in:
Zeno Rogue 2024-04-07 23:37:00 +02:00
parent 824fa9a732
commit 7fc90f116b
1 changed files with 1 additions and 1 deletions

View File

@ -2586,7 +2586,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
treasure_rate += variant::features[i].rate_change;
variant::features[i].build(c);
}
if(hrand(2000 - PT(kills[moVariantWarrior] * 5, 250)) < treasure_rate && !c->wall && !c->monst)
if(hrand(max(100, 2000 - PT(kills[moVariantWarrior] * 5, 250))) < treasure_rate && !c->wall && !c->monst)
c->item = itVarTreasure;
}
if(d == 7 && c->wall == waTrapdoor) {