]> granicus.if.org Git - nethack/commit
fix M159 - crash at end of prayer
authornethack.rankin <nethack.rankin>
Fri, 2 Sep 2005 06:00:44 +0000 (06:00 +0000)
committernethack.rankin <nethack.rankin>
Fri, 2 Sep 2005 06:00:44 +0000 (06:00 +0000)
commit8ce7216a0c55b4424c1aeefbe27ba0ce27d04360
tree37e8558c7d18ec717cf98c586ee54cc051a8bfbc
parentbbc825f9d978da6b7c6aac62f7fe9862fba43dbc
fix M159 - crash at end of prayer

     Fix the crash caused by division by zero (attempt to compute rn2(0))
when deciding prayer boon for a character whose Luck went negative during
the course of the prayer.  <email deleted> triggered it
by killing a shopkeeper with the ongoing damage from a scroll of stinking
cloud; his non-chaotic character was branded a murderer and lost two points
of Luck after the prayer was already in progress.  (Prayers fail when Luck
is already negative, so the code to pick a boon expects non-negative values;
the fact that is always adds at least +2 leads to me to suspect that someone
already realized that luck timeout on Friday 13th could result in Luck of -1
at the end of a successful prayer--that value doesn't trigger this crash.)
doc/fixes34.4
src/pray.c