From 82337beeddbb30a895f2d9fb16ca757077d2966d Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Wed, 21 Sep 2022 22:19:42 -0400 Subject: [PATCH] Prevent impossible fall dmg if falling up The way hole destinations work now theoretically allows for a cross-branch hole or trap door to move you across branches in a way that decreases your overall depth. If this happened, it would cause an impossible when the negative result of (depth(new) - depth(old)) was used to calculate fall damage. Limit fall damage to 1d6 if dist <= 0. --- src/do.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do.c b/src/do.c index 3f1ee04c3..9e2fd69a3 100644 --- a/src/do.c +++ b/src/do.c @@ -1822,7 +1822,7 @@ goto_level( /* fall damage? */ if (do_fall_dmg) { - int dmg = d(dist, 6); + int dmg = d(max(dist, 1), 6); dmg = Maybe_Half_Phys(dmg); losehp(dmg, "falling down a mine shaft", KILLED_BY);