From e80970dccfcba7a956e57b2e75aa8dd8df6d7c36 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 30 Nov 2006 02:18:49 +0000 Subject: [PATCH] north-south drawbridge From a bug report: zapping a wand of striking or locking or spell of force bolt or wizard lock up or down when standing at an open drawbridge's portcullis didn't affect the bridge if the portcullis was positioned north of the open span. One of the two drawbridges on the Valkyrie quest goal level has that orientation. is_drawbridge_wall()'s name is somewhat misleading; it isn't boolean and returns -1 rather than 0 for "no". --- doc/fixes34.4 | 2 ++ src/zap.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 0448c2643..33eb87839 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -277,6 +277,8 @@ wielding a cloak of magic resistance or gray dragon scales, or carrying one in to polymorphed hero wielding a potion of blindness or carrying one in alternate weapon or quiver slot conferred resistance against light-based blindness to any hero +zapping closing or breaking magic up or down from beneath an open drawbridge's + portcullis failed if bridge orientation was north-to-south (Valk quest) Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index dbfbcba54..27b71c6ea 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2495,7 +2495,7 @@ struct obj *obj; /* wand or spell */ case SPE_WIZARD_LOCK: /* down at open bridge or up or down at open portcullis */ if (((levl[x][y].typ == DRAWBRIDGE_DOWN) ? (u.dz > 0) : - (is_drawbridge_wall(x,y) && !is_db_wall(x,y))) && + (is_drawbridge_wall(x,y) >= 0 && !is_db_wall(x,y))) && find_drawbridge(&xx, &yy)) { if (!striking) close_drawbridge(xx, yy);