mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops
This commit is contained in:
Vendored
+6
-6
@@ -1,8 +1,8 @@
|
||||
var/global/datum/repository/powermonitor/powermonitor_repository = new()
|
||||
GLOBAL_DATUM_INIT(powermonitor_repository, /datum/repository/powermonitor, new())
|
||||
|
||||
/datum/repository/powermonitor/proc/powermonitor_data(var/refresh = 0)
|
||||
var/pMonData[0]
|
||||
|
||||
|
||||
var/datum/cache_entry/cache_entry = cache_data
|
||||
if(!cache_entry)
|
||||
cache_entry = new/datum/cache_entry
|
||||
@@ -10,15 +10,15 @@ var/global/datum/repository/powermonitor/powermonitor_repository = new()
|
||||
|
||||
if(!refresh)
|
||||
return cache_entry.data
|
||||
|
||||
|
||||
for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors)
|
||||
if( !(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor )
|
||||
pMonData[++pMonData.len] = list ("Name" = pMon.name, "ref" = "\ref[pMon]")
|
||||
|
||||
cache_entry.timestamp = world.time //+ 30 SECONDS
|
||||
cache_entry.data = pMonData
|
||||
cache_entry.data = pMonData
|
||||
return pMonData
|
||||
|
||||
|
||||
/datum/repository/powermonitor/proc/update_cache()
|
||||
return powermonitor_data(refresh = 1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user