From a9134fa6436f90e1b3f4d76a8a6e451df781e7aa Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Sat, 25 Jan 2025 22:16:45 -0500 Subject: [PATCH] fix catwalk cabling placement when clicking on space (#28117) --- code/game/turfs/space/space_turf.dm | 2 ++ code/game/turfs/turf.dm | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/code/game/turfs/space/space_turf.dm b/code/game/turfs/space/space_turf.dm index d0caaaa58b4..355d7ea9216 100644 --- a/code/game/turfs/space/space_turf.dm +++ b/code/game/turfs/space/space_turf.dm @@ -117,6 +117,8 @@ to_chat(user, "The plating is going to need some support! Place metal rods first.") return ITEM_INTERACT_COMPLETE + return ..() + /turf/space/Entered(atom/movable/A as mob|obj, atom/OL, ignoreRest = 0) ..() if((!(A) || !(src in A.locs))) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index b2c02b58364..07a9085f487 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -478,28 +478,28 @@ if(SSticker) GLOB.cameranet.update_visibility(src) -/turf/attack_by(obj/item/attacking, mob/user, params) - if(..()) - return TRUE +/turf/item_interaction(mob/living/user, obj/item/used, list/modifiers) if(can_lay_cable()) - if(istype(attacking, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/C = attacking + if(istype(used, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/C = used for(var/obj/structure/cable/LC in src) if(LC.d1 == 0 || LC.d2 == 0) LC.attackby__legacy__attackchain(C, user) - return TRUE + return ITEM_INTERACT_COMPLETE C.place_turf(src, user) - return TRUE - else if(istype(attacking, /obj/item/rcl)) - var/obj/item/rcl/R = attacking + return ITEM_INTERACT_COMPLETE + else if(istype(used, /obj/item/rcl)) + var/obj/item/rcl/R = used if(R.loaded) for(var/obj/structure/cable/LC in src) if(LC.d1 == 0 || LC.d2 == 0) LC.attackby__legacy__attackchain(R, user) - return TRUE + return ITEM_INTERACT_COMPLETE R.loaded.place_turf(src, user) R.is_empty(user) + return ITEM_INTERACT_COMPLETE + /turf/proc/can_have_cabling() return TRUE