From 12ccc4e7a790649b3477ae6a126b721dd7fefe04 Mon Sep 17 00:00:00 2001 From: MarinaGryphon Date: Fri, 14 Jul 2017 11:55:14 -0500 Subject: [PATCH] Attempting fixes for some hoist bugs. (#3027) Hoists now release hoistees if they wriggle out somehow. Shouldn't happen anyway, but consistency_check should handle any odd shenanigans. Silicons should be able to be hoisted. Buckling wasn't anchoring them, for some strange reason. Fixed a bad message, where [user] was used instead of [usr]. You can't directly unbuckle people from hoist hooks. --- code/game/objects/structures/lattice.dm | 6 ++++++ code/modules/multiz/hoist.dm | 24 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 097636944b0..a803e08bdac 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -90,3 +90,9 @@ queue_smooth_neighbors(src) else ..() + +/obj/structure/lattice/catwalk/hoist_act(turf/dest) + for (var/A in src) + var/atom/movable/AM = A + AM.hoist_act(dest) + ..() \ No newline at end of file diff --git a/code/modules/multiz/hoist.dm b/code/modules/multiz/hoist.dm index 396f8a5bfa4..6f7295ce65c 100644 --- a/code/modules/multiz/hoist.dm +++ b/code/modules/multiz/hoist.dm @@ -22,6 +22,9 @@ can_buckle = 1 anchored = 1 +/obj/effect/hoist_hook/attack_hand(mob/living/user) + return // no, bad + /obj/effect/hoist_hook/MouseDrop_T(atom/movable/AM,mob/user) var/canuse = use_check(user, USE_DISALLOW_SILICONS) if(canuse) // to cut it down from 4+ return statements to just 1 @@ -51,8 +54,7 @@ hoistee = AM if(ismob(AM)) source_hook.buckle_mob(AM) - else - AM.anchored = 1 + AM.anchored = 1 // why isn't this being set by buckle_mob for silicons? /obj/effect/hoist_hook/MouseDrop(atom/dest) ..() @@ -76,9 +78,11 @@ if (!dest.Adjacent(source_hoist.hoistee)) return + source_hoist.check_consistency() + var/turf/desturf = dest source_hoist.hoistee.forceMove(desturf) - usr.visible_message(span("danger", "[user] detaches \the [source_hoist.hoistee] from the hoist clamp."), span("danger", "You detach \the [source_hoist.hoistee] from the hoist clamp."), span("danger", "You hear something unclamp.")) + usr.visible_message(span("danger", "[usr] detaches \the [source_hoist.hoistee] from the hoist clamp."), span("danger", "You detach \the [source_hoist.hoistee] from the hoist clamp."), span("danger", "You hear something unclamp.")) source_hoist.release_hoistee() /obj/structure/hoist @@ -110,6 +114,13 @@ source_hoist = null return ..() +/obj/structure/hoist/proc/check_consistency() + if (!hoistee) + return + if (hoistee.z != source_hook.z) + release_hoistee() + return + /obj/structure/hoist/proc/release_hoistee() if(ismob(hoistee)) source_hook.unbuckle_mob(hoistee) @@ -185,6 +196,8 @@ move_dir(movedir, 0) return + check_consistency() + var/size if (ismob(hoistee)) var/mob/M = hoistee @@ -243,5 +256,8 @@ source_hook.forceMove(move_dest) if (!ishoisting) return 1 - hoistee.forceMove(move_dest) + hoistee.hoist_act(move_dest) return 1 + +/atom/movable/proc/hoist_act(turf/dest) + src.forceMove(dest) \ No newline at end of file