]> granicus.if.org Git - nethack/commitdiff
R759 - delayed were change could cause crash
authorcohrs <cohrs>
Sat, 6 Apr 2002 17:24:15 +0000 (17:24 +0000)
committercohrs <cohrs>
Sat, 6 Apr 2002 17:24:15 +0000 (17:24 +0000)
moveloop() sets a flag when a were/poly change should occur, but it
delays this change if the hero is Unchanging or cannot be interrupted (e.g.
praying).  However, by the time the change can be applied, the reason
may no longer be valid.  Reset the change indicator when this is the case.
Avoids possible strange polymorphs and were crashes.

doc/fixes34.1
src/allmain.c

index be82331450bd54c03e10ec899f8a6bdbc51b97ec..07a8110d2496a1796719f09a9fbb49ade980f024 100644 (file)
@@ -53,6 +53,7 @@ avoid temporary disappearing Burdened message due to updating status line
 don't credit player's wisdom when makelevel creates random Elbereth engravings
 reduce insect/monster creation from monster spells
 avoid "couldn't place lregion type 5" warning when arriving at Plane of Fire
+avoid crash due to delayed poly or were change no longer being valid
 
 
 Platform- and/or Interface-Specific Fixes
index 13c71c6d9ae600234062282a19b3978d6adef030..63e1c42b5db073a77a3cd20c018471979ac0d94e 100644 (file)
@@ -233,6 +233,10 @@ moveloop()
                            }
 #endif
                        }
+                       /* delayed change may not be valid anymore */
+                       if ((change == 1 && !Polymorph) ||
+                           (change == 2 && u.ulycn == NON_PM))
+                           change = 0;
                        if(Polymorph && !rn2(100))
                            change = 1;
                        else if (u.ulycn >= LOW_PM && !rn2(80 - (20 * night())))