From be7bc6dda80c65cc5f61979a7e095b3ab8b7eefd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 13 Oct 2022 23:23:57 +0200 Subject: [PATCH] [MIRROR] Fixes Weird Vending Machine Untipping Behavior (Cyborg Edition) [MDB IGNORE] (#16842) * Fixes Weird Vending Machine Untipping Behavior (Cyborg Edition) (#70448) * Adds an Adjacency Check for untipping Vending Machines Hey there, Basically, if you were a cyborg, you could untip a vending machine from halfway across the world. There was no adjacency check for pretty much anyone to untip a vending machine, and since a cyborg will always pass through on anything that interacts with an `/obj/machinery`, it would always untip no matter how far away the person was. In fact, we even have an `isAI` check down the line because I think AI's could remotely untip any vending machine (lol). Let's just pass in an adjacency check for this. Phew. * an even earlier return * alright let's actually not override base behavior * updates the check later on in the chain * Fixes Weird Vending Machine Untipping Behavior (Cyborg Edition) Co-authored-by: san7890 --- code/modules/vending/_vending.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 12508a69d01..3f01ff23754 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -854,12 +854,12 @@ GLOBAL_LIST_EMPTY(vending_products) obj_flags |= EMAGGED to_chat(user, span_notice("You short out the product lock on [src].")) -/obj/machinery/vending/_try_interact(mob/user) +/obj/machinery/vending/interact(mob/user) if(seconds_electrified && !(machine_stat & NOPOWER)) if(shock(user, 100)) return - if(tilted && !user.buckled && !isAI(user)) + if(tilted && !user.buckled && !isAdminGhostAI(user)) to_chat(user, span_notice("You begin righting [src].")) if(do_after(user, 50, target=src)) untilt(user)