Merge remote-tracking branch 'Upstream/master' into Solar_updates

This commit is contained in:
Artur
2020-02-20 13:15:46 +02:00
783 changed files with 10552 additions and 5708 deletions
+19 -1
View File
@@ -18,7 +18,15 @@
/obj/machinery/power/tracker/Initialize(mapload, obj/item/solar_assembly/S)
. = ..()
Make(S)
if(!S)
assembly = new /obj/item/solar_assembly
assembly.glass_type = new /obj/item/stack/sheet/glass(null, 2)
assembly.tracker = TRUE
assembly.anchored = TRUE
else
S.moveToNullspace()
assembly = S
update_icon()
connect_to_network()
RegisterSignal(SSsun, COMSIG_SUN_MOVED, .proc/sun_update)
@@ -39,6 +47,16 @@
control.connected_tracker = null
control = null
//updates the tracker icon and the facing angle for the control computer
/obj/machinery/power/tracker/proc/set_angle(angle)
sun_angle = angle
//set icon dir to show sun illumination
setDir(turn(NORTH, -angle - 22.5) )// 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet
control.currentdir = angle
///Tell the controller to turn the solar panels
/obj/machinery/power/tracker/proc/sun_update(datum/source, azimuth)
setDir(angle2dir(azimuth))