Merge pull request #8998 from MistakeNot4892/events

Might fix vending machines being selected offstation.
This commit is contained in:
Sypsoti
2023-03-02 08:07:41 -06:00
committed by GitHub
2 changed files with 12 additions and 15 deletions

View File

@@ -1,3 +1,13 @@
/proc/get_vendors_on_station()
. = list()
for(var/obj/machinery/vending/V in machines)
if(isNotStationLevel(V.z))
continue
var/area/A = get_area(V)
if(!(A?.area_flags & AREA_FLAG_IS_STATION_AREA))
continue
. += V
/datum/event/brand_intelligence
announceWhen = 21
endWhen = 1000 //Ends when all vending machines are subverted anyway.
@@ -11,16 +21,8 @@
command_announcement.Announce("An ongoing mass upload of malware for vendors has been detected onboard [station_name()], which appears to transmit \
to other nearby vendors. The original infected machine is believed to be \a [originMachine.name].", "Vendor Service Alert")
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
if(isNotStationLevel(V.z))
continue
var/area/A = get_area(V)
if(!(A?.area_flags & AREA_FLAG_IS_STATION_AREA))
continue
vendingMachines.Add(V)
vendingMachines = get_vendors_on_station()
if(!vendingMachines.len)
kill()
return

View File

@@ -20,16 +20,11 @@
var/last_malware_spread_time = null
/datum/event2/event/brand_intelligence/set_up()
for(var/obj/machinery/vending/V in machines)
if(!(V.z in using_map.station_levels))
continue
vending_machines += V
vending_machines = get_vendors_on_station()
if(!vending_machines.len)
log_debug("Could not find any vending machines on station Z levels. Aborting.")
abort()
return
vender_zero = pick(vending_machines)
/datum/event2/event/brand_intelligence/announce()