Fixes bugs with the syndie chainsaw and the dsword when trying to wield them but failing (#15102)

* Fixes the wield proc of the syndie chainsaw and dsword

* unwield of dsword

* Review changes
This commit is contained in:
Farie82
2020-12-16 13:59:34 -05:00
committed by GitHub
parent 84b5f7d300
commit c373535782
+18 -10
View File
@@ -32,7 +32,7 @@
/obj/item/twohanded/proc/unwield(mob/living/carbon/user)
if(!wielded || !user)
return
return FALSE
wielded = FALSE
force = force_unwielded
if(sharp_when_wielded)
@@ -55,18 +55,19 @@
var/obj/item/twohanded/offhand/O = user.get_inactive_hand()
if(O && istype(O))
O.unwield()
return TRUE
/obj/item/twohanded/proc/wield(mob/living/carbon/user)
if(wielded)
return
return FALSE
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.dna.species.is_small)
to_chat(user, "<span class='warning'>It's too heavy for you to wield fully.</span>")
return
return FALSE
if(user.get_inactive_hand())
to_chat(user, "<span class='warning'>You need your other hand to be empty!</span>")
return
return FALSE
wielded = TRUE
force = force_wielded
if(sharp_when_wielded)
@@ -86,6 +87,7 @@
O.name = "[name] - offhand"
O.desc = "Your second grip on the [name]"
user.put_in_inactive_hand(O)
return TRUE
/obj/item/twohanded/dropped(mob/user)
..()
@@ -337,7 +339,9 @@
blade_color = "blue"
/obj/item/twohanded/dualsaber/unwield()
..()
. = ..()
if(!.)
return
hitsound = "swing_hit"
w_class = initial(w_class)
@@ -349,7 +353,9 @@
if(HULK in M.mutations)
to_chat(M, "<span class='warning'>You lack the grace to wield this!</span>")
return
..()
. = ..()
if(!.)
return
hitsound = 'sound/weapons/blade1.ogg'
w_class = w_class_on
@@ -616,12 +622,14 @@
return ..()
/obj/item/twohanded/chainsaw/wield() //you can't disarm an active chainsaw, you crazy person.
..()
flags |= NODROP
. = ..()
if(.)
flags |= NODROP
/obj/item/twohanded/chainsaw/unwield()
..()
flags &= ~NODROP
. = ..()
if(.)
flags &= ~NODROP
// SINGULOHAMMER
/obj/item/twohanded/singularityhammer