-Fixed Fire Alarm timers, the issue was caused by the fact that they were no longer processing, on account of it not really being necessary. I changed it so that they only process so long as they are timing, and changed the timing to work off of world.timeofday so it won't be affected by lag (Did that for the purpose of shenanigans).

Fixes Issue 987
-Added donkie's list shuffle for Space Ninjas, was trying to work on Issue 904 and saw that it didn't shuffle the candidates so I added that, though I doubt it will fix the problem.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4828 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
sieve32@gmail.com
2012-10-07 21:45:04 +00:00
parent 5ccdec380d
commit c9897bf3f7
2 changed files with 24 additions and 16 deletions

View File

@@ -140,10 +140,11 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
var/list/candidates = list() //list of candidate keys
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5)
if(G.client && !G.client.holder && ((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
if(!candidates.len) return
candidates = shuffle(candidates)//Incorporating Donkie's list shuffle
//The ninja will be created on the right spawn point or at late join.

View File

@@ -1008,6 +1008,9 @@ table tr:first-child th:first-child { border: none;}
spawn(rand(0,15))
update_icon()
/obj/machinery/firealarm
var/last_process = 0
/obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume)
if(src.detecting)
if(temperature > T0C+200)
@@ -1039,26 +1042,28 @@ table tr:first-child th:first-child { border: none;}
src.add_fingerprint(user)
return
/obj/machinery/firealarm/process()
/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed
if(stat & (NOPOWER|BROKEN))
return
var/area/A = src.loc
A = A.loc
// var/area/A = src.loc
// A = A.loc
if(A.fire)
src.icon_state = "fire1"
else
src.icon_state = "fire0"
// if(A.fire)
// src.icon_state = "fire1"
// else
// src.icon_state = "fire0"
if (src.timing)
if (src.time > 0)
src.time = round(src.time) - 1
if(src.timing)
if(src.time > 0)
src.time = src.time - ((world.timeofday - last_process)/10)
else
alarm()
src.alarm()
src.time = 0
src.timing = 0
processing_objects.Remove(src)
src.updateDialog()
last_process = world.timeofday
return
/obj/machinery/firealarm/power_change()
@@ -1089,8 +1094,8 @@ table tr:first-child th:first-child { border: none;}
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Lock</A>", src)
else
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Lock</A>", src)
var/second = src.time % 60
var/minute = (src.time - second) / 60
var/second = round(src.time) % 60
var/minute = (round(src.time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>Fire alarm</B> [d1]\n<HR>The current alert level is: [get_security_level()]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? "[minute]:" : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
@@ -1104,8 +1109,8 @@ table tr:first-child th:first-child { border: none;}
d2 = text("<A href='?src=\ref[];time=0'>[]</A>", src, stars("Stop Time Lock"))
else
d2 = text("<A href='?src=\ref[];time=1'>[]</A>", src, stars("Initiate Time Lock"))
var/second = src.time % 60
var/minute = (src.time - second) / 60
var/second = round(src.time) % 60
var/minute = (round(src.time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>[stars("Fire alarm")]</B> [d1]\n<HR><b>The current alert level is: [stars(get_security_level())]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? text("[]:", minute) : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
@@ -1125,6 +1130,8 @@ table tr:first-child th:first-child { border: none;}
else
if (href_list["time"])
src.timing = text2num(href_list["time"])
last_process = world.timeofday
processing_objects.Add(src)
else
if (href_list["tp"])
var/tp = text2num(href_list["tp"])