mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +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
+4
-4
@@ -1,4 +1,4 @@
|
||||
var/global/datum/repository/air_alarm/air_alarm_repository = new()
|
||||
GLOBAL_DATUM_INIT(air_alarm_repository, /datum/repository/air_alarm, new())
|
||||
|
||||
/datum/repository/air_alarm/proc/air_alarm_data(var/list/monitored_alarms, var/refresh = 0, var/obj/machinery/alarm/passed_alarm)
|
||||
var/alarms[0]
|
||||
@@ -11,13 +11,13 @@ var/global/datum/repository/air_alarm/air_alarm_repository = new()
|
||||
if(!refresh)
|
||||
return cache_entry.data
|
||||
|
||||
if(SSticker && SSticker.current_state < GAME_STATE_PLAYING && istype(passed_alarm)) // Generating the list for the first time as the game hasn't started - no need to run through the machines list everything every time
|
||||
if(SSticker && SSticker.current_state < GAME_STATE_PLAYING && istype(passed_alarm)) // Generating the list for the first time as the game hasn't started - no need to run through the machines list everything every time
|
||||
alarms = cache_entry.data // Don't deleate the list
|
||||
if(is_station_contact(passed_alarm.z) && passed_alarm.remote_control) // Still need sanity checks
|
||||
alarms[++alarms.len] = passed_alarm.get_nano_data_console()
|
||||
alarms[++alarms.len] = passed_alarm.get_nano_data_console()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : GLOB.air_alarms)) // Generating the whole list again is a bad habit but I can't be bothered to fix it right now
|
||||
if(!monitored_alarms && !is_station_contact(alarm.z))
|
||||
if(!monitored_alarms && !is_station_contact(alarm.z))
|
||||
continue
|
||||
if(!alarm.remote_control)
|
||||
continue
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
var/global/datum/repository/apc/apc_repository = new()
|
||||
GLOBAL_DATUM_INIT(apc_repository, /datum/repository/apc, new())
|
||||
|
||||
/datum/repository/apc/proc/apc_data(datum/powernet/powernet)
|
||||
var/apcData[0]
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
var/global/datum/repository/crew/crew_repository = new()
|
||||
GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())
|
||||
|
||||
/datum/repository/crew/New()
|
||||
cache_data = list()
|
||||
|
||||
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