From 52fb4b03ac30d80035c89c3788d0b93905ec9ef4 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 5 Oct 2019 05:29:57 +0200
Subject: [PATCH] we are only keeping track of the number of singu beacons, var
more efficient.
---
code/game/machinery/syndicatebeacon.dm | 6 +++---
code/modules/events/meteor_wave.dm | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 175a3f72ec..3fb78ad37f 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -1,4 +1,4 @@
-GLOBAL_INIT_LIST(singularity_beacons)
+GLOBAL_VAR_INIT(singularity_counter, 0)
#define METEOR_DISASTER_MODIFIER 0.5
@@ -29,7 +29,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
if(user)
to_chat(user, "The connected wire doesn't have enough current.")
return
- GLOB.singularity_beacons += src
+ GLOB.singularity_counter++
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
W.weight += round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
for(var/obj/singularity/singulo in GLOB.singularities)
@@ -49,7 +49,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
active = 0
if(user)
to_chat(user, "You deactivate the beacon.")
- GLOB.singularity_beacons -= src
+ GLOB.singularity_counter--
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm
index fc10b5ac90..6f01caa275 100644
--- a/code/modules/events/meteor_wave.dm
+++ b/code/modules/events/meteor_wave.dm
@@ -21,8 +21,8 @@
/datum/round_event/meteor_wave/setup()
announceWhen = 1
startWhen = rand(300, 600) //Yeah for SOME REASON this is measured in seconds and not deciseconds???
- if(GLOB.singularity_beacons.len)
- startWhen *= 1 - min(GLOB.singularity_beacons.len * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
+ if(GLOB.singularity_counter)
+ startWhen *= 1 - min(GLOB.singularity_counter * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
endWhen = startWhen + 60