Merge pull request #4761 from Citadel-Station-13/upstream-merge-34206

[MIRROR] Fixes twohanded weapons not unwielding when you lose an arm.
This commit is contained in:
LetterJay
2018-01-11 15:18:55 -06:00
committed by GitHub
+13 -1
View File
@@ -43,6 +43,8 @@
update_icon()
if(user.get_item_by_slot(slot_back) == src)
user.update_inv_back()
else
user.update_inv_hands()
if(show_message)
if(iscyborg(user))
to_chat(user, "<span class='notice'>You free up your module.</span>")
@@ -119,13 +121,23 @@
name = "offhand"
icon_state = "offhand"
w_class = WEIGHT_CLASS_HUGE
flags_1 = ABSTRACT_1 | NODROP_1
flags_1 = ABSTRACT_1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/item/twohanded/offhand/Destroy()
wielded = FALSE
return ..()
/obj/item/twohanded/offhand/dropped(mob/living/user, show_message = TRUE) //Only utilized by dismemberment since you can't normally switch to the offhand to drop it.
var/obj/I = user.get_active_held_item()
if(I && istype(I, /obj/item/twohanded))
var/obj/item/twohanded/thw = I
thw.unwield(user, show_message)
if(istype(thw, /obj/item/twohanded/required))
user.dropItemToGround(thw)
if(!QDELETED(src))
qdel(src)
/obj/item/twohanded/offhand/unwield()
if(wielded)//Only delete if we're wielded
wielded = FALSE