From 2986a807dec4f8c807820ba5122ecd3122925996 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 26 Oct 2018 15:09:48 -0700 Subject: [PATCH] fix #7470 - Sting vs webs When trapped in a web, trying to move while wielding Sting gives the message "Sting cuts through the web." In 3.6.1 and earler, that also released you from the trap, but with 3.6.2-beta nothing happens. It had nothing to do with the recent web spinning patch. My change to have being trapped block levitating and flying included replacing a lot of direct manipulations of u.utrap with set_utrap() and reset_utrap() in order to keep the lev/fly blocking and unblocking localized. Unfortunately, the old 'u.utrap = 0' when wielding Sting while stuck in web was deleted in error at that time. --- doc/fixes36.2 | 1 + src/hack.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 5b5f058ce..a3e09411a 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -184,6 +184,7 @@ orctown: prevent Bad fruit #0 and some minor tuning make long extended commands list be more navigable simplify #wizidentify; don't rely on having bold menu entries ensure tmp_at() structures are initialized for all code paths when swallowed +trapped-vs-levitation/flying change broke Sting releasing hero from web tty: turn off an optimization that is the suspected cause of Windows reported partial status lines following level changes tty: ensure that current status fields are always copied to prior status diff --git a/src/hack.c b/src/hack.c index 29261a968..0593bd683 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 hack.c $NHDT-Date: 1518861490 2018/02/17 09:58:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.182 $ */ +/* NetHack 3.6 hack.c $NHDT-Date: 1540591769 2018/10/26 22:09:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.194 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1213,8 +1213,10 @@ struct trap *desttrap; /* nonnull if another trap at */ break; case TT_WEB: if (uwep && uwep->oartifact == ART_STING) { + /* escape trap but don't move and don't destroy it */ + u.utrap = 0; /* caller will call reset_utrap() */ pline("Sting cuts through the web!"); - break; /* escape trap but don't move */ + break; } if (--u.utrap) { if (flags.verbose) {