[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 <the@san7890.com>
This commit is contained in:
SkyratBot
2022-10-13 17:23:57 -04:00
committed by GitHub
co-authored by san7890
parent 79f6f1c0c3
commit be7bc6dda8
+2 -2
View File
@@ -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)