Makes solars auto-track again (#13278)

* Makes solars auto-track again

* Forgot this
This commit is contained in:
AffectedArc07
2020-04-11 22:46:09 +01:00
committed by GitHub
parent 925ffa7584
commit 42da9918d7
3 changed files with 18 additions and 6 deletions
+11 -2
View File
@@ -1,19 +1,28 @@
SUBSYSTEM_DEF(sun)
name = "Sun"
wait = 600
flags = SS_NO_TICK_CHECK|SS_NO_INIT
flags = SS_NO_TICK_CHECK
init_order = INIT_ORDER_SUN
var/angle
var/dx
var/dy
var/rate
var/list/solars = list()
/datum/controller/subsystem/sun/PreInit()
/datum/controller/subsystem/sun/Initialize(start_timeofday)
// Lets work out an angle for the "sun" to rotate around the station
angle = rand (0,360) // the station position to the sun is randomised at round start
rate = rand(50,200)/100 // 50% - 200% of standard rotation
if(prob(50)) // same chance to rotate clockwise than counter-clockwise
rate = -rate
// Solar consoles need to load after machines init, so this handles that
for(var/obj/machinery/power/solar_control/SC in solars)
SC.setup()
return ..()
/datum/controller/subsystem/sun/stat_entry(msg)
..("P:[solars.len]")