From 0d2e623f4e8e233b541ed90f551137d61305c026 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 5 Aug 2019 00:41:32 -0700 Subject: [PATCH 1/3] Update click.dm --- code/_onclick/click.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 22210bfd08..4af61c99c7 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -200,7 +200,7 @@ if (!target.loc) continue - if(!(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_BLOCK_REACH)) + if(!(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_BLOCK_REACH) && !ismob(target.loc)) next += target.loc checking = next From 2426849d4b482ca487de2c2f764b310f7f41eba3 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Tue, 22 Oct 2019 02:19:33 -0700 Subject: [PATCH 2/3] this is a pretty bad idea --- code/_onclick/click.dm | 6 +++++- code/datums/components/storage/storage.dm | 6 ++++++ code/game/objects/structures/crates_lockers/closets.dm | 3 +++ code/modules/mob/inventory.dm | 3 +++ tgstation.dme | 5 ++--- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index b73696ed80..58eabbdbcf 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -200,7 +200,7 @@ if (!target.loc) continue - if(!(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_BLOCK_REACH) && !ismob(target.loc)) + if(!(SEND_SIGNAL(target.loc, COMSIG_ATOM_CANREACH, next) & COMPONENT_BLOCK_REACH) && target.loc.canReachInto(src, ultimate_target, next, view_only, tool)) next += target.loc checking = next @@ -215,6 +215,10 @@ /mob/living/DirectAccess(atom/target) return ..() + GetAllContents() +//This is called reach into but it's called on the deepest things first so uh, make sure to account for that! +/atom/proc/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool) + return TRUE + /atom/proc/AllowClick() return FALSE diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index adec6f67ce..c439f38126 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -96,6 +96,7 @@ RegisterSignal(parent, COMSIG_ITEM_PICKUP, .proc/signal_on_pickup) RegisterSignal(parent, COMSIG_MOVABLE_POST_THROW, .proc/close_all) + RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/check_views) RegisterSignal(parent, COMSIG_CLICK_ALT, .proc/on_alt_click) RegisterSignal(parent, COMSIG_MOUSEDROP_ONTO, .proc/mousedrop_onto) @@ -386,6 +387,11 @@ close(M) . = TRUE //returns TRUE if any mobs actually got a close(M) call +/datum/component/storage/proc/check_views() + for(var/mob/M in can_see_contents()) + if(!isobserver(M) && !M.CanReach(src, view_only = TRUE)) + close(M) + /datum/component/storage/proc/emp_act(datum/source, severity) if(emp_shielded) return diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 8b0d410a72..172120861b 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -614,3 +614,6 @@ user.resting = FALSE togglelock(user) T1.visible_message("[user] dives into [src]!") + +/obj/structure/closet/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool) + return ..() && opened diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 760fb7a29f..e77a91332e 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -468,3 +468,6 @@ bodyparts += BP hand_bodyparts[i] = BP ..() //Don't redraw hands until we have organs for them + +/mob/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool) + return ..() && (user == src) diff --git a/tgstation.dme b/tgstation.dme index 612a98974c..f13e7c4763 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -623,7 +623,6 @@ #include "code\game\machinery\syndicatebomb.dm" #include "code\game\machinery\teleporter.dm" #include "code\game\machinery\transformer.dm" -#include "code\game\machinery\turnstile.dm" #include "code\game\machinery\washing_machine.dm" #include "code\game\machinery\wishgranter.dm" #include "code\game\machinery\camera\camera.dm" @@ -715,7 +714,6 @@ #include "code\game\mecha\combat\gygax.dm" #include "code\game\mecha\combat\honker.dm" #include "code\game\mecha\combat\marauder.dm" -#include "code\game\mecha\combat\neovgre.dm" #include "code\game\mecha\combat\phazon.dm" #include "code\game\mecha\combat\reticence.dm" #include "code\game\mecha\equipment\mecha_equipment.dm" @@ -1040,7 +1038,6 @@ #include "code\game\objects\structures\crates_lockers\closets\bodybag.dm" #include "code\game\objects\structures\crates_lockers\closets\cardboardbox.dm" #include "code\game\objects\structures\crates_lockers\closets\fitness.dm" -#include "code\game\objects\structures\crates_lockers\closets\genpop.dm" #include "code\game\objects\structures\crates_lockers\closets\gimmick.dm" #include "code\game\objects\structures\crates_lockers\closets\job_closets.dm" #include "code\game\objects\structures\crates_lockers\closets\l3closet.dm" @@ -2490,6 +2487,7 @@ #include "code\modules\projectiles\guns\energy\kinetic_accelerator.dm" #include "code\modules\projectiles\guns\energy\laser.dm" #include "code\modules\projectiles\guns\energy\megabuster.dm" +#include "code\modules\projectiles\guns\energy\minigun.dm" #include "code\modules\projectiles\guns\energy\mounted.dm" #include "code\modules\projectiles\guns\energy\plasma_cit.dm" #include "code\modules\projectiles\guns\energy\pulse.dm" @@ -3118,6 +3116,7 @@ #include "modular_citadel\code\modules\projectiles\guns\ballistic\spinfusor.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\energy_gun.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\laser.dm" +#include "modular_citadel\code\modules\projectiles\projectile\energy.dm" #include "modular_citadel\code\modules\projectiles\projectiles\reusable.dm" #include "modular_citadel\code\modules\reagents\chemistry\reagents\astrogen.dm" #include "modular_citadel\code\modules\reagents\chemistry\reagents\eigentstasium.dm" From 52e0092e04e3e9df60b4a505e4160ef6a01d52bb Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Tue, 22 Oct 2019 02:22:04 -0700 Subject: [PATCH 3/3] dme --- tgstation.dme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tgstation.dme b/tgstation.dme index f13e7c4763..612a98974c 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -623,6 +623,7 @@ #include "code\game\machinery\syndicatebomb.dm" #include "code\game\machinery\teleporter.dm" #include "code\game\machinery\transformer.dm" +#include "code\game\machinery\turnstile.dm" #include "code\game\machinery\washing_machine.dm" #include "code\game\machinery\wishgranter.dm" #include "code\game\machinery\camera\camera.dm" @@ -714,6 +715,7 @@ #include "code\game\mecha\combat\gygax.dm" #include "code\game\mecha\combat\honker.dm" #include "code\game\mecha\combat\marauder.dm" +#include "code\game\mecha\combat\neovgre.dm" #include "code\game\mecha\combat\phazon.dm" #include "code\game\mecha\combat\reticence.dm" #include "code\game\mecha\equipment\mecha_equipment.dm" @@ -1038,6 +1040,7 @@ #include "code\game\objects\structures\crates_lockers\closets\bodybag.dm" #include "code\game\objects\structures\crates_lockers\closets\cardboardbox.dm" #include "code\game\objects\structures\crates_lockers\closets\fitness.dm" +#include "code\game\objects\structures\crates_lockers\closets\genpop.dm" #include "code\game\objects\structures\crates_lockers\closets\gimmick.dm" #include "code\game\objects\structures\crates_lockers\closets\job_closets.dm" #include "code\game\objects\structures\crates_lockers\closets\l3closet.dm" @@ -2487,7 +2490,6 @@ #include "code\modules\projectiles\guns\energy\kinetic_accelerator.dm" #include "code\modules\projectiles\guns\energy\laser.dm" #include "code\modules\projectiles\guns\energy\megabuster.dm" -#include "code\modules\projectiles\guns\energy\minigun.dm" #include "code\modules\projectiles\guns\energy\mounted.dm" #include "code\modules\projectiles\guns\energy\plasma_cit.dm" #include "code\modules\projectiles\guns\energy\pulse.dm" @@ -3116,7 +3118,6 @@ #include "modular_citadel\code\modules\projectiles\guns\ballistic\spinfusor.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\energy_gun.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\laser.dm" -#include "modular_citadel\code\modules\projectiles\projectile\energy.dm" #include "modular_citadel\code\modules\projectiles\projectiles\reusable.dm" #include "modular_citadel\code\modules\reagents\chemistry\reagents\astrogen.dm" #include "modular_citadel\code\modules\reagents\chemistry\reagents\eigentstasium.dm"