]> granicus.if.org Git - nethack/commitdiff
vampshifter resurrection while being held
authorPatR <rankin@nethack.org>
Wed, 23 Jan 2019 01:54:58 +0000 (17:54 -0800)
committerPatR <rankin@nethack.org>
Wed, 23 Jan 2019 01:54:58 +0000 (17:54 -0800)
If poly'd hero is holding a bat/cloud/wolf which dies and revives as a
vampire, release the hold.

doc/fixes36.2
include/extern.h
src/mon.c
src/polyself.c

index f4130f94d0d064473897bf72d4c4e6839844cf1f..4028cda99c3ee0515ee1e1b4b4a74767a2f28d3d 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.232 $ $NHDT-Date: 1547849604 2019/01/18 22:13:24 $
+$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.234 $ $NHDT-Date: 1548208486 2019/01/23 01:54:46 $
 
 This fixes36.2 file is here to capture information about updates in the 3.6.x
 lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -343,6 +343,8 @@ the simulation of dual weapon combat when polymorphed into a form with more
        even when current shape couldn't handle silver, or if it was cursed;
        cursed is allowed but weapon will be dropped, just like in two-weapon
 demons gated in other demons without any message
+if vampire revives from from dead bat/cloud/wolf shape held by hero poly'd
+       into grabber, release it from hero's grasp
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index dd27db8aaf494044c192bfd0a2c4024ad9f1244d..019cdaa162dbf0e85a5394a69cae125913be33bc 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 extern.h        $NHDT-Date: 1547486885 2019/01/14 17:28:05 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.682 $ */
+/* NetHack 3.6 extern.h        $NHDT-Date: 1548208224 2019/01/23 01:50:24 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.683 $ */
 /* Copyright (c) Steve Creps, 1988.                              */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1906,6 +1906,7 @@ E int NDECL(dogaze);
 E int NDECL(dohide);
 E int NDECL(dopoly);
 E int NDECL(domindblast);
+E void NDECL(uunstick);
 E void FDECL(skinback, (BOOLEAN_P));
 E const char *FDECL(mbodypart, (struct monst *, int));
 E const char *FDECL(body_part, (int));
index 73df0bcd80e5cbe4846b16070ee27fd7365816fd..570b95244320447aec6a861c4ea1cd291bfe7554 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mon.c   $NHDT-Date: 1545430257 2018/12/21 22:10:57 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.276 $ */
+/* NetHack 3.6 mon.c   $NHDT-Date: 1548208236 2019/01/23 01:50:36 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.277 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1943,9 +1943,14 @@ register struct monst *mtmp;
             if (mtmp->mhpmax <= 0)
                 mtmp->mhpmax = 10;
             mtmp->mhp = mtmp->mhpmax;
-            /* this can happen if previously a fog cloud */
-            if (u.uswallow && (mtmp == u.ustuck))
-                expels(mtmp, mtmp->data, FALSE);
+            /* mtmp==u.ustuck can happen if previously a fog cloud
+               or poly'd hero is hugging a vampire bat */
+            if (mtmp == u.ustuck) {
+                if (u.uswallow)
+                    expels(mtmp, mtmp->data, FALSE);
+                else
+                    uunstick();
+            }
             if (in_door) {
                 coord new_xy;
 
index fec59787c8ff26514cca52954052caefeeb45964..a326827b512b88d66ed2b646e394eae21f7ecd6a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 polyself.c      $NHDT-Date: 1547086249 2019/01/10 02:10:49 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.125 $ */
+/* NetHack 3.6 polyself.c      $NHDT-Date: 1548208238 2019/01/23 01:50:38 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.126 $ */
 /*      Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -25,7 +25,6 @@ STATIC_DCL void FDECL(check_strangling, (BOOLEAN_P));
 STATIC_DCL void FDECL(polyman, (const char *, const char *));
 STATIC_DCL void NDECL(break_armor);
 STATIC_DCL void FDECL(drop_weapon, (int));
-STATIC_DCL void NDECL(uunstick);
 STATIC_DCL int FDECL(armor_to_dragon, (int));
 STATIC_DCL void NDECL(newman);
 STATIC_DCL void NDECL(polysense);
@@ -747,10 +746,14 @@ int mntmp;
     }
     newsym(u.ux, u.uy); /* Change symbol */
 
+    /* [note:  this 'sticky' handling is only sufficient for changing from
+       grabber to engulfer or vice versa because engulfing by poly'd hero
+       always ends immediately so won't be in effect during a polymorph] */
     if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data))
         u.ustuck = 0;
     else if (sticky && !sticks(youmonst.data))
         uunstick();
+
     if (u.usteed) {
         if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) {
             pline("%s touch %s.", no_longer_petrify_resistant,
@@ -1541,9 +1544,13 @@ domindblast()
     return 1;
 }
 
-STATIC_OVL void
+void
 uunstick()
 {
+    if (!u.ustuck) {
+        impossible("uunstick: no ustuck?");
+        return;
+    }
     pline("%s is no longer in your clutches.", Monnam(u.ustuck));
     u.ustuck = 0;
 }