mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Makes solars auto-track again (#13278)
* Makes solars auto-track again * Forgot this
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
#define INIT_ORDER_TIMER 1
|
||||
#define INIT_ORDER_DEFAULT 0
|
||||
#define INIT_ORDER_AIR -1
|
||||
#define INIT_ORDER_SUN -2
|
||||
#define INIT_ORDER_MINIMAP -3
|
||||
#define INIT_ORDER_ASSETS -4
|
||||
#define INIT_ORDER_ICON_SMOOTHING -5
|
||||
|
||||
@@ -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]")
|
||||
|
||||
|
||||
@@ -285,13 +285,15 @@
|
||||
autostart = 1 // Automatically start
|
||||
|
||||
/obj/machinery/power/solar_control/Initialize()
|
||||
..()
|
||||
if(!powernet)
|
||||
return
|
||||
SSsun.solars |= src
|
||||
setup()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/solar_control/proc/setup()
|
||||
connect_to_network()
|
||||
set_panels(cdir)
|
||||
if(autostart)
|
||||
src.search_for_connected()
|
||||
search_for_connected()
|
||||
if(connected_tracker && track == 2)
|
||||
connected_tracker.set_angle(SSsun.angle)
|
||||
set_panels(cdir)
|
||||
|
||||
Reference in New Issue
Block a user