From cddef89fc0a9ea65f60afd87fbe766d4d4c913d0 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 28 Jun 2023 06:17:00 +0200 Subject: [PATCH] [MIRROR] Changes brand intelligence to check onstation var instead of station z level. Well, kind of both. [MDB IGNORE] (#22109) * Changes brand intelligence to check onstation var instead of station z level. Well, kind of both. (#76266) ## About The Pull Request Checks the `.onstation` var on `/obj/machinery/vending` instead of checking the z-level directly. The z-level check is already run in init to set this var in the first place, but this way it allows the var to be set manually to secure vendors that are on the station z-level but are not wanted as candidates for brand intelligence. This scenario doesn't currently exist here, but it affects things like https://github.com/Skyrat-SS13/Skyrat-tg/issues/21918 and future-proofing is always nice. I did consider doing this as another var, but that felt a bit excessive. Can change if wanted. (also removes some duplicate comments because I was there) ## Why It's Good For The Game Wasted events uhh bad ## Changelog :cl: fix: Brand intelligence can no longer affect off-station vendors in some specific circumstances. /:cl: * Changes brand intelligence to check onstation var instead of station z level. Well, kind of both. --------- Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> --- code/modules/events/brand_intelligence.dm | 2 +- code/modules/vending/_vending.dm | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index 813be9b3d8b..b1d6e055506 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -35,7 +35,7 @@ /datum/round_event/brand_intelligence/setup() //select our origin machine (which will also be the type of vending machine affected.) for(var/obj/machinery/vending/vendor in GLOB.machines) - if(!is_station_level(vendor.z)) + if(!vendor.onstation) continue if(!vendor.density) continue diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index e3d0ef2c023..3b4098b51c0 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -165,10 +165,11 @@ * Is this item on station or not * * if it doesn't originate from off-station during mapload, everything is free + * if it's off-station during mapload, it's also safe from the brand intelligence event */ - var/onstation = TRUE //if it doesn't originate from off-station during mapload, everything is free - ///A variable to change on a per instance basis on the map that allows the instance to force cost and ID requirements - var/onstation_override = FALSE //change this on the object on the map to override the onstation check. DO NOT APPLY THIS GLOBALLY. + var/onstation = TRUE + ///A variable to change on a per instance basis on the map that allows the instance to force cost and ID requirements. DO NOT APPLY THIS GLOBALLY. + var/onstation_override = FALSE var/list/vending_machine_input = list() ///Display header on the input view