Wielding Guns and Backpacks Fix (#11445)

This commit is contained in:
Geeves
2021-03-15 17:54:14 +02:00
committed by GitHub
parent b52d3c743a
commit 334bbbd7a6
3 changed files with 16 additions and 12 deletions
+9 -11
View File
@@ -701,12 +701,8 @@
to_chat(user, SPAN_NOTICE("You are no-longer stabilizing \the [name] with both hands."))
var/obj/item/offhand/O = user.get_inactive_hand()
if(O && istype(O))
if(istype(O))
O.unwield()
else
O = user.get_active_hand()
return
else
if(user.get_inactive_hand())
to_chat(user, SPAN_WARNING("You need your other hand to be empty."))
@@ -751,11 +747,10 @@
/obj/item/gun/mob_can_equip(M as mob, slot, disable_warning, ignore_blocked)
//Cannot equip wielded items.
if(is_wieldable)
if(wielded)
if(!disable_warning) // unfortunately not sure there's a way to get this to only fire once when it's looped
to_chat(M, SPAN_WARNING("Lower \the [initial(name)] first!"))
return FALSE
if(wielded)
if(!disable_warning) // unfortunately not sure there's a way to get this to only fire once when it's looped
to_chat(M, SPAN_WARNING("Lower \the [initial(name)] first!"))
return FALSE
return ..()
@@ -814,7 +809,7 @@
if(user)
var/obj/item/gun/O = user.get_inactive_hand()
if(istype(O))
to_chat(user, SPAN_NOTICE("You are no-longer stabilizing \the [name] with both hands."))
to_chat(user, SPAN_NOTICE("You are no-longer stabilizing \the [O] with both hands."))
O.unwield()
unwield()
@@ -822,6 +817,9 @@
qdel(src)
/obj/item/offhand/mob_can_equip(var/mob/M, slot, disable_warning = FALSE)
var/static/list/equippable_slots = list(slot_l_hand, slot_r_hand)
if(slot in equippable_slots)
return TRUE
return FALSE
/obj/item/gun/Destroy()