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:
committed by
Pasi Kallinen
parent
e148d5e925
commit
82337beedd
2
src/do.c
2
src/do.c
@@ -1822,7 +1822,7 @@ goto_level(
|
|||||||
|
|
||||||
/* fall damage? */
|
/* fall damage? */
|
||||||
if (do_fall_dmg) {
|
if (do_fall_dmg) {
|
||||||
int dmg = d(dist, 6);
|
int dmg = d(max(dist, 1), 6);
|
||||||
|
|
||||||
dmg = Maybe_Half_Phys(dmg);
|
dmg = Maybe_Half_Phys(dmg);
|
||||||
losehp(dmg, "falling down a mine shaft", KILLED_BY);
|
losehp(dmg, "falling down a mine shaft", KILLED_BY);
|
||||||
|
|||||||
Reference in New Issue
Block a user