From 9524894d3fe757649d2aae81d6ecc08c3b063813 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Wed, 26 Jun 2002 05:54:50 +0000 Subject: [PATCH] naming wielded weapons I'm surprised that no one has noticed this one yet. When wielding two weapons, naming either of them caused two-weapon combat mode to stop (unless the weapon already had another name which was long enough to be overwritten by the new name without allocating a replacement object). --- doc/fixes34.1 | 1 + src/do_name.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 007fe358d..86c2cebe3 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -123,6 +123,7 @@ fix crash when using lookat on an known invisible monster with monster syms set prevent getting stuck in infinite loop when using wizard mode #levelchange command to reduce level while having level-drain resistance naming an already wielded elven dagger "Sting" activates warning against orcs +naming either of the wielded weapons unintentionally ends two-weapon combat Platform- and/or Interface-Specific Fixes diff --git a/src/do_name.c b/src/do_name.c index b5757b23d..1d439433e 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -361,8 +361,12 @@ const char *name; } if (obj->owornmask) { + boolean save_twoweap = u.twoweap; + /* unwearing the old instance will clear dual-wield mode + if this object is either of the two weapons */ setworn((struct obj *)0, obj->owornmask); setworn(otmp, otmp->owornmask); + u.twoweap = save_twoweap; } /* replace obj with otmp */ -- 2.40.0