]> granicus.if.org Git - nethack/commitdiff
Drawbridge collapse bug
authorcohrs <cohrs>
Fri, 25 Mar 2005 22:33:05 +0000 (22:33 +0000)
committercohrs <cohrs>
Fri, 25 Mar 2005 22:33:05 +0000 (22:33 +0000)
From a bug report, it is possible for the hero to
appear embedded in the wall after destroying the drawbridge.  This is because
The variable "lev1", which was the entity's location, was being referenced
after e_died, but e_died can change the entity's location.  So, as <Someone>
suggested, refer to the current location directly.

doc/fixes34.4
src/dbridge.c

index c803e1177ec97affb3a2618d3821c1cb5ceaac55..20b7955239af47c2569e49f9259e8a5f16342dae 100644 (file)
@@ -105,6 +105,7 @@ busy pet won't miss out upon ascension
 fix various places that "finally finished" could be displayed after the hero
        stopped doing something other than eating
 fix some cases where movement was disallowed but the hero was still conscious
+after destroying drawbridge, hero could appear to be in the wall
 
 
 Platform- and/or Interface-Specific Fixes
index 6b25158facdde9b51109401ea97865ec5beeeb3f..cc3f03f542ef9481b9940d2699789a560b151d5f 100644 (file)
@@ -921,7 +921,8 @@ int x,y;
                        killer.format = KILLED_BY_AN;
                        Strcpy(killer.name, "collapsing drawbridge");
                        e_died(etmp1, e_inview? 3 : 2, CRUSHING); /*no corpse*/
-                       if(lev1->typ == MOAT) do_entity(etmp1);
+                       if(levl[etmp1->ex][etmp1->ey].typ == MOAT)
+                           do_entity(etmp1);
                }
        }
 }