From f4af5ed28c7614820f487a9fff561c286cf2b005 Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 11 Jul 2020 20:25:27 +0200 Subject: [PATCH] Makes CanReach default to blocking. (#52115) --- code/__DEFINES/dcs/signals.dm | 2 +- code/_onclick/click.dm | 3 ++- code/datums/components/storage/storage.dm | 2 +- code/game/objects/items/bodybag.dm | 7 ------- code/game/objects/structures/crates_lockers/closets.dm | 5 ----- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 437ce41b6bb..dec82ddda9d 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -132,7 +132,7 @@ #define COMPONENT_RAD_WAVE_HANDLED (1<<0) ///from internal loop in atom/movable/proc/CanReach(): (list/next) #define COMSIG_ATOM_CANREACH "atom_can_reach" - #define COMPONENT_BLOCK_REACH (1<<0) + #define COMPONENT_ALLOW_REACH (1<<0) ///from base of atom/screwdriver_act(): (mob/living/user, obj/item/I) #define COMSIG_ATOM_SCREWDRIVER_ACT "atom_screwdriver_act" ///from base of atom/wrench_act(): (mob/living/user, obj/item/I) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 061b5a3b990..ab70cc4a286 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -203,7 +203,8 @@ if (!target.loc) continue - if(!(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_BLOCK_REACH)) + //Storage and things with reachable internal atoms need add to next here. Or return COMPONENT_ALLOW_REACH. + if(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_ALLOW_REACH) next += target.loc checking = next diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 367fbc42d8d..9458e4153e0 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -173,7 +173,7 @@ var/datum/component/storage/concrete/master = master() if(!master) return - . = COMPONENT_BLOCK_REACH + . = COMPONENT_ALLOW_REACH next += master.parent for(var/i in master.slaves) var/datum/component/storage/slave = i diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index a04f9724b25..2a38b4020b3 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -45,10 +45,6 @@ w_class = WEIGHT_CLASS_SMALL item_flags = NO_MAT_REDEMPTION -/obj/item/bodybag/bluespace/Initialize() - . = ..() - RegisterSignal(src, COMSIG_ATOM_CANREACH, .proc/CanReachReact) - /obj/item/bodybag/bluespace/examine(mob/user) . = ..() if(contents.len) @@ -62,9 +58,6 @@ to_chat(A, "You suddenly feel the space around you torn apart! You're free!") return ..() -/obj/item/bodybag/bluespace/proc/CanReachReact(atom/movable/source, list/next) - return COMPONENT_BLOCK_REACH - /obj/item/bodybag/bluespace/deploy_bodybag(mob/user, atom/location) var/obj/structure/closet/body_bag/R = new unfoldedbag_path(location) for(var/atom/movable/A in contents) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index eb8de6fa75e..fecaaf06e23 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -46,11 +46,6 @@ update_icon() PopulateContents() - RegisterSignal(src, COMSIG_ATOM_CANREACH, .proc/canreach_react) - -/obj/structure/closet/proc/canreach_react(datum/source, list/next) - return COMPONENT_BLOCK_REACH //closed block, open have nothing inside. - //USE THIS TO FILL IT, NOT INITIALIZE OR NEW /obj/structure/closet/proc/PopulateContents() return