* Polished the malf timer logic

* added a protection to prevent division by 0 when all hacked apcs are destroyed
* added a midnight rollover check for the MC (fixes #4905)
* toggling breakers won't add/remove a hacked APC from the AI apcs pool anymore
This commit is contained in:
Menshin
2014-09-28 12:16:21 +02:00
parent 88d26ee22d
commit ed807f8538
7 changed files with 19 additions and 20 deletions
+3 -2
View File
@@ -127,9 +127,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(ticker.mode)
//world << "DEBUG: ticker not null"
if(ticker.mode.name == "AI malfunction")
var/datum/game_mode/malfunction/malf = ticker.mode
//world << "DEBUG: malf mode ticker test"
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(malf.malf_mode_declared && (malf.apcs > 0))
stat(null, "Time left: [max(malf.AI_win_timeleft/malf.apcs, 0)]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()