[MIRROR] Fixes deployable turrets not actually being undeployable. (#27655)

* Fixes deployable turrets not actually being undeployable. (#83061)

Fixes #83053

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* Fixes deployable turrets not actually being undeployable.

---------

Co-authored-by: Afevis <ShizCalev@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-05-09 08:36:12 +02:00
committed by GitHub
co-authored by MrMelbert Afevis
parent 35a7f722c9
commit 249495424b
@@ -51,19 +51,21 @@
/// Undeploying, for when you want to move your big dakka around
/obj/machinery/deployable_turret/wrench_act(mob/living/user, obj/item/wrench/used_wrench)
. = ..()
if(!can_be_undeployed)
return
return ITEM_INTERACT_SKIP_TO_ATTACK
if(!ishuman(user))
return
return ITEM_INTERACT_SKIP_TO_ATTACK
used_wrench.play_tool_sound(user)
user.balloon_alert(user, "undeploying...")
if(!do_after(user, undeploy_time))
return
var/obj/undeployed_object = new spawned_on_undeploy(src)
return ITEM_INTERACT_BLOCKING
var/obj/undeployed_object = new spawned_on_undeploy()
//Keeps the health the same even if you redeploy the gun
undeployed_object.modify_max_integrity(max_integrity)
if(!user.put_in_hands(undeployed_object))
undeployed_object.forceMove(loc)
qdel(src)
return ITEM_INTERACT_SUCCESS
//BUCKLE HOOKS