From 8e063814f4583ac8cd7fbccd72f5002b92ca2a83 Mon Sep 17 00:00:00 2001 From: cohrs Date: Fri, 25 Mar 2005 22:33:05 +0000 Subject: [PATCH] Drawbridge collapse bug 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 suggested, refer to the current location directly. --- doc/fixes34.4 | 1 + src/dbridge.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index c803e1177..20b795523 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/dbridge.c b/src/dbridge.c index 6b25158fa..cc3f03f54 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -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); } } } -- 2.40.0