From 7fc90f116bdeeffe1bd31b705cc329e890eced63 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 7 Apr 2024 23:37:00 +0200 Subject: [PATCH] fixed a possible crash after killing 400 mutants --- landgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/landgen.cpp b/landgen.cpp index fd2c2dca..55028b3c 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -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) {