Fixes wieldable items un-wielding when hovered over a compatible storage slot. (#20102)

Fixes #20098 
Thanks to @Geevies for helping me untangle this code!
This commit is contained in:
Snowy1237
2024-10-25 17:55:24 +00:00
committed by GitHub
parent d3e8605451
commit 641d9fa3b0
2 changed files with 62 additions and 3 deletions
+4 -3
View File
@@ -813,14 +813,15 @@
#undef LYING_DOWN_FIRE_DELAY_AND_RECOIL_STAT_MULTIPLIER
#undef LYING_DOWN_ACCURACY_STAT_MULTIPLIER
/obj/item/gun/mob_can_equip(mob/user, slot, disable_warning, ignore_blocked)
//Cannot equip wielded items.
/obj/item/gun/on_slotmove(mob/user, slot, disable_warning, ignore_blocked)
. = ..()
if(!.)
return
if(wielded)
unwield()
var/obj/item/offhand/O = user.get_inactive_hand()
if(istype(O))
O.unwield()
return ..()
/obj/item/gun/throw_at()
..()