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).
This commit is contained in:
nethack.rankin
2002-06-26 05:54:50 +00:00
parent fbeccb7257
commit 9524894d3f
2 changed files with 5 additions and 0 deletions

View File

@@ -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

View File

@@ -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 */