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:
11
src/mkobj.c
11
src/mkobj.c
@@ -2737,15 +2737,20 @@ obj_sanity_check(void)
|
||||
/* objects temporarily freed from invent/floor lists;
|
||||
they should have arrived somewhere by the time we get called */
|
||||
if (gt.thrownobj)
|
||||
insane_object(gt.thrownobj, ofmt3, "gt.thrownobj sanity",
|
||||
insane_object(gt.thrownobj, ofmt3, "thrownobj sanity",
|
||||
(struct monst *) 0);
|
||||
if (gk.kickedobj)
|
||||
insane_object(gk.kickedobj, ofmt3, "gk.kickedobj sanity",
|
||||
insane_object(gk.kickedobj, ofmt3, "kickedobj sanity",
|
||||
(struct monst *) 0);
|
||||
/* returning_missile temporarily remembers thrownobj and should be
|
||||
Null in between moves */
|
||||
if (iflags.returning_missile)
|
||||
insane_object(gk.kickedobj, ofmt3, "returning_missile sanity",
|
||||
(struct monst *) 0);
|
||||
/* gc.current_wand isn't removed from invent while in use, but should
|
||||
be Null between moves when we're called */
|
||||
if (gc.current_wand)
|
||||
insane_object(gc.current_wand, ofmt3, "gc.current_wand sanity",
|
||||
insane_object(gc.current_wand, ofmt3, "current_wand sanity",
|
||||
(struct monst *) 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user