From 8a6c0d80aa6a508cf613d5877da2f752b9cb047f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 11 Feb 2024 05:21:35 +0100 Subject: [PATCH] [MIRROR] [FIX] Makes Deathtrap Recycler Movable (#26458) * [FIX] Makes Deathtrap Recycler Movable (#81282) ## About The Pull Request Fixes #81205 ~~Adds a new flag for letting you move otherwise un-deconstructable objects and making deconstructable objects immovable with a wrench.~~ ~~Adds that flag onto the ORM.~~ makes ~~ORM un-unwrenchable,~~ deathtrap recycler unwrenchable. ## Why It's Good For The Game seems like an oversight on the recycler that unnecessarily limited gimmicks, ~~and one of the long-running peeves with something like the ORM has been how damn easy it is to walk up to it, unwrench it, and walk into cargo through the windoor mapped for mineral storage access (which basically everyone has.) This makes it so if you'd otherwise do that, now you at least need to either deconstruct or destroy the ORM first (or just take another less obvious way in.) Always seemed like an oversight but can atomize it if wanted.~~ atomized out, will ask around before putting back up ## Changelog :cl: fix: deathtrap recycler can now be moved. refactor: moved check for NO_DECONSTRUCTION flag to be inside can_be_unfasten_wrench, allowing us to set specific machines to be movable but not deconstructable. /:cl: * [FIX] Makes Deathtrap Recycler Movable --------- Co-authored-by: Higgin --- code/game/machinery/recycler.dm | 6 ++++++ code/game/objects/objs.dm | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 0f6002c9725..2ee22338d0e 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -83,6 +83,12 @@ default_unfasten_wrench(user, tool) return ITEM_INTERACT_SUCCESS +/obj/machinery/recycler/can_be_unfasten_wrench(mob/user, silent) + if(!(isfloorturf(loc) || isindestructiblefloor(loc)) && !anchored) + to_chat(user, span_warning("[src] needs to be on the floor to be secured!")) + return FAILED_UNFASTEN + return SUCCESSFUL_UNFASTEN + /obj/machinery/recycler/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) return diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 91f1ca925ab..cb57c5049bb 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -373,6 +373,8 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) /// If we can unwrench this object; returns SUCCESSFUL_UNFASTEN and FAILED_UNFASTEN, which are both TRUE, or CANT_UNFASTEN, which isn't. /obj/proc/can_be_unfasten_wrench(mob/user, silent) + if(obj_flags & NO_DECONSTRUCTION) + return CANT_UNFASTEN if(!(isfloorturf(loc) || isindestructiblefloor(loc)) && !anchored) to_chat(user, span_warning("[src] needs to be on the floor to be secured!")) return FAILED_UNFASTEN @@ -380,7 +382,7 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) /// Try to unwrench an object in a WONDERFUL DYNAMIC WAY /obj/proc/default_unfasten_wrench(mob/user, obj/item/wrench, time = 20) - if((obj_flags & NO_DECONSTRUCTION) || wrench.tool_behaviour != TOOL_WRENCH) + if(wrench.tool_behaviour != TOOL_WRENCH) return CANT_UNFASTEN var/turf/ground = get_turf(src)