From 1ebe9f34e9f8799bdc2d3e9745bca8e0a6a3d9b1 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Sun, 27 Apr 2014 17:39:56 -0400 Subject: [PATCH] Solar fixes --- code/datums/sun.dm | 3 ++- code/modules/power/solar.dm | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/datums/sun.dm b/code/datums/sun.dm index a2a1143e8bf..1748ea158e7 100644 --- a/code/datums/sun.dm +++ b/code/datums/sun.dm @@ -61,7 +61,8 @@ // Solar Control else if(istype(M, /obj/machinery/power/solar_control)) var/obj/machinery/power/solar_control/C = M - C.tracker_update() //update manual tracker + if(C.track == 1) //if manual tracking... + C.tracker_update() //...update the position (not passing an angle, it is handled internally for manual tracking) // Solar Panel else if(istype(M, /obj/machinery/power/solar)) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 1de1a7b55a4..c43fbb24874 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -375,7 +375,7 @@ var/list/solars_list = list() if(stat & (NOPOWER | BROKEN)) return - if(track==1 && trackrate) + if(track==1 && trackrate) //manual tracking and set a rotation speed if(nexttime <= world.time) //every time we need to increase/decrease the angle by 1°... targetdir = (targetdir + trackrate/abs(trackrate) + 360) % 360 //... do it nexttime += 36000/abs(trackrate) //reset the counter for the next 1° @@ -388,10 +388,10 @@ var/list/solars_list = list() /obj/machinery/power/solar_control/proc/tracker_update(var/angle) if(stat & (NOPOWER | BROKEN) || track == 0) return - if (track == 2) + if (track == 2) // auto-tracking (called by tracker.dm /set_angle) cdir = angle - else if (track == 1 && trackrate) //if manual tracking... - cdir = targetdir //...the current direction is the targetted one (and rotates panels to it) + else if (trackrate) //else we're manual tracking. If we set a rotation speed... + cdir = targetdir //...the current direction is the targetted one (and rotates panels to it) set_panels(cdir) src.updateDialog()