fix github issue #302 - divide by 0 crash
The traceback points directly to the problem: divide by 0 happens if the 'bogusmon' file only contains the "do not edit" line, which would happen if 'bogusmon.txt' is empty. makedefs probably ought to complain about that. There is now one hardcoded bogus monster to fall back to: 'bogon'. Random tombstone epitaphs report divide by 0 if their text source is empty, but it is done by rn2() rather than rn2_for_display_rng() so is just a warning for pre-release code. It would crash for release version though. I tried placing an empty engravings file and expected similar results but didn't see any response. Not sure what that means. After the fix, empty epitaph file yields blank result so graves that want a random epitaph won't have any epitaph. Fixes #302
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.106 $ $NHDT-Date: 1582321542 2020/02/21 21:45:42 $
|
||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.107 $ $NHDT-Date: 1582364458 2020/02/22 09:40:58 $
|
||||
|
||||
General Fixes and Modified Features
|
||||
-----------------------------------
|
||||
@@ -58,6 +58,7 @@ give feedback if controlled level teleport attempt fails because hero is
|
||||
unseen pet that drowned didn't give "you have a sad feeling" message
|
||||
prevent ravens from blinding other ravens: /corvus oculum corvi non eruit/
|
||||
have ^X provide more information when held or swallowed
|
||||
avoid divide by 0 crash if 'bogusmon' (file of bogus monster types) is empty
|
||||
|
||||
|
||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||
|
||||
Reference in New Issue
Block a user