groundwork: u.twoweap manipulation

Toggle u.twoweap on or off in just one place.
This commit is contained in:
PatR
2020-04-03 11:42:17 -07:00
parent d58e449d6c
commit 8f73f926b1
9 changed files with 32 additions and 19 deletions

View File

@@ -66,7 +66,7 @@ long mask;
impossible("Setworn: mask = %ld.", wp->w_mask);
if (oobj) {
if (u.twoweap && (oobj->owornmask & (W_WEP | W_SWAPWEP)))
u.twoweap = 0;
set_twoweap(FALSE); /* u.twoweap = FALSE */
oobj->owornmask &= ~wp->w_mask;
if (wp->w_mask & ~(W_SWAPWEP | W_QUIVER)) {
/* leave as "x = x <op> y", here and below, for broken
@@ -120,8 +120,8 @@ register struct obj *obj;
if (!obj)
return;
if (obj == uwep || obj == uswapwep)
u.twoweap = 0;
if (u.twoweap && (obj == uwep || obj == uswapwep))
set_twoweap(FALSE); /* u.twoweap = FALSE */
for (wp = worn; wp->w_mask; wp++)
if (obj == *(wp->w_obj)) {
/* in case wearing or removal is in progress or removal