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.
This commit is contained in:
Michael Meyer
2022-09-21 22:19:42 -04:00
committed by Pasi Kallinen
parent e148d5e925
commit 82337beedd

View File

@@ -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);