fix boomerang equiped in multiple slots

Reported directly to devteam:  with one quivered boomerang and a
compatable stack of one or more boomerangs either wielded or in the
alternate weapon slot, throwing the quivered one, failing to hit any
target or obstacle, and catching the returning boomerang would empty
the quiver, merge the caught boomerang with the wielded weapon or
swap-weapon slot, then re-quiver and yield
|x - 2 boomerangs (wielded) (at the ready)
or
|y - 2 boomerangs (alternate weapon; not wielded) (at the ready)
If 'sanity_check' was On, complaints would ensue.

'autoquiver' may need to be On in addition to the thrown boomerang
being the last item in the quiver.

The unsplit portion of the fix feels unclean.  There's bound to be a
better way.
This commit is contained in:
PatR
2022-12-24 00:27:59 -08:00
parent 9657b78359
commit 9a9f2d596d
3 changed files with 71 additions and 25 deletions

View File

@@ -4524,10 +4524,7 @@ mergable(
if (obj->oartifact != otmp->oartifact)
return FALSE;
if (obj->known == otmp->known || !objects[otmp->otyp].oc_uses_known) {
return (boolean) objects[obj->otyp].oc_merge;
} else
return FALSE;
return (obj->known == otmp->known) ? TRUE : FALSE;
}
/* the #showgold command */