From 620a8170879fbd89f3429d9217017cd66e58b2d8 Mon Sep 17 00:00:00 2001 From: Deantwo Date: Mon, 28 Apr 2014 15:52:02 +0200 Subject: [PATCH] Fixes Midnight Rollover Protection * Fixed the non-existent Midnight Rollover Protection. * Moved Midnight Rollover Protection to "timeleft()". * Removed "direction == 2" check, because "direction" is never 2. --- code/controllers/shuttle_controller.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index 2f8c2204921..86684a3a145 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -86,7 +86,10 @@ datum/shuttle_controller proc/timeleft() if(online) var/timeleft = round((endtime - world.timeofday)/10 ,1) - if(direction == 1 || direction == 2) + if(timeleft > MIDNIGHT_ROLLOVER) // midnight rollover protection + endtime -= MIDNIGHT_ROLLOVER // subtract 24 hours from endtime + timeleft = round((endtime - world.timeofday)/10 ,1) // recalculate timeleft + if(direction == 1) return timeleft else return SHUTTLEARRIVETIME-timeleft @@ -146,11 +149,9 @@ datum/shuttle_controller if(!online) return var/timeleft = timeleft() - if(timeleft > 1e5) // midnight rollover protection - timeleft = 0 if(location == UNDOCKED) if(direction == -1) - if(timeleft >= timelimit) + if(timeleft >= timelimit) // Shuttle reaches CentCom after being recalled. online = 0 direction = 1 endtime = null