mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
global lists global defined
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
|
||||
/datum/controller/process/fast_process/statProcess()
|
||||
..()
|
||||
stat(null, "[fast_processing.len] fast processes")
|
||||
stat(null, "[GLOB.fast_processing.len] fast processes")
|
||||
|
||||
/datum/controller/process/fast_process/doWork()
|
||||
for(last_object in fast_processing)
|
||||
for(last_object in GLOB.fast_processing)
|
||||
var/obj/O = last_object
|
||||
try
|
||||
O.process()
|
||||
|
||||
@@ -12,18 +12,18 @@ var/global/datum/controller/process/npcai/npcai_master
|
||||
|
||||
/datum/controller/process/npcai/started()
|
||||
..()
|
||||
if(!simple_animal_list)
|
||||
simple_animal_list = list()
|
||||
if(!snpc_list)
|
||||
snpc_list = list()
|
||||
if(!GLOB.simple_animal_list)
|
||||
GLOB.simple_animal_list = list()
|
||||
if(!GLOB.snpc_list)
|
||||
GLOB.snpc_list = list()
|
||||
|
||||
/datum/controller/process/npcai/statProcess()
|
||||
..()
|
||||
stat(null, "[simple_animal_list.len] simple animals")
|
||||
stat(null, "[snpc_list.len] SNPC's")
|
||||
stat(null, "[GLOB.simple_animal_list.len] simple animals")
|
||||
stat(null, "[GLOB.snpc_list.len] SNPC's")
|
||||
|
||||
/datum/controller/process/npcai/doWork()
|
||||
for(last_object in simple_animal_list)
|
||||
for(last_object in GLOB.simple_animal_list)
|
||||
var/mob/living/simple_animal/M = last_object
|
||||
if(istype(M) && !QDELETED(M))
|
||||
if(!M.client && M.stat == CONSCIOUS)
|
||||
@@ -34,15 +34,15 @@ var/global/datum/controller/process/npcai/npcai_master
|
||||
SCHECK
|
||||
else
|
||||
catchBadType(M)
|
||||
simple_animal_list -= M
|
||||
GLOB.simple_animal_list -= M
|
||||
|
||||
if(ticker.current_state == GAME_STATE_FINISHED && !saved_voice)
|
||||
var/mob/living/carbon/human/interactive/M = safepick(snpc_list)
|
||||
var/mob/living/carbon/human/interactive/M = safepick(GLOB.snpc_list)
|
||||
if(M)
|
||||
M.saveVoice()
|
||||
saved_voice = 1
|
||||
|
||||
for(last_object in snpc_list)
|
||||
for(last_object in GLOB.snpc_list)
|
||||
var/mob/living/carbon/human/interactive/M = last_object
|
||||
if(istype(M) && !QDELETED(M))
|
||||
try
|
||||
@@ -53,7 +53,7 @@ var/global/datum/controller/process/npcai/npcai_master
|
||||
SCHECK
|
||||
else
|
||||
catchBadType(M)
|
||||
snpc_list -= M
|
||||
GLOB.snpc_list -= M
|
||||
|
||||
current_cycle++
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ DECLARE_GLOBAL_CONTROLLER(shuttle, shuttle_master)
|
||||
/datum/controller/process/shuttle/proc/autoEvac()
|
||||
var/callShuttle = 1
|
||||
|
||||
for(var/thing in shuttle_caller_list)
|
||||
for(var/thing in GLOB.shuttle_caller_list)
|
||||
if(istype(thing, /mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = thing
|
||||
if(AI.stat || !AI.client)
|
||||
|
||||
@@ -54,20 +54,20 @@ GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
message_admins("<span class='adminnotice'>Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5 - defcon) * processing_interval] ticks.</span>")
|
||||
--defcon
|
||||
if(2)
|
||||
to_chat(admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5 - defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5 - defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</span>")
|
||||
--defcon
|
||||
if(1)
|
||||
|
||||
to_chat(admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5 - defcon) * processing_interval] ticks. Killing and restarting...</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5 - defcon) * processing_interval] ticks. Killing and restarting...</span>")
|
||||
--defcon
|
||||
var/rtn = Recreate_MC()
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
to_chat(admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
to_chat(GLOB.admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
else if(rtn < 0)
|
||||
log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0")
|
||||
to_chat(admins, "<span class='boldannounce'>ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.</span>")
|
||||
//if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again
|
||||
//no need to handle that specially when defcon 0 can handle it
|
||||
if(0) //DEFCON 0! (mc failed to restart)
|
||||
@@ -75,7 +75,7 @@ GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
to_chat(admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
to_chat(GLOB.admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
else
|
||||
defcon = min(defcon + 1,5)
|
||||
master_iteration = Master.iteration
|
||||
|
||||
@@ -149,7 +149,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined."
|
||||
BadBoy.flags |= SS_NO_FIRE
|
||||
if(msg)
|
||||
to_chat(admins, "<span class='boldannounce'>[msg]</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>[msg]</span>")
|
||||
log_world(msg)
|
||||
|
||||
if(istype(Master.subsystems))
|
||||
@@ -609,7 +609,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
/datum/controller/master/proc/UpdateTickRate()
|
||||
if(!processing)
|
||||
return
|
||||
var/client_count = length(clients)
|
||||
var/client_count = length(GLOB.clients)
|
||||
if(client_count < config.disable_high_pop_mc_mode_amount)
|
||||
processing = config.base_mc_tick_rate
|
||||
else if(client_count > config.high_pop_mc_mode_amount)
|
||||
|
||||
@@ -66,8 +66,8 @@ SUBSYSTEM_DEF(air)
|
||||
/datum/controller/subsystem/air/Initialize(timeofday)
|
||||
setup_overlays() // Assign icons and such for gas-turf-overlays
|
||||
setup_allturfs()
|
||||
setup_atmos_machinery(machines)
|
||||
setup_pipenets(machines)
|
||||
setup_atmos_machinery(GLOB.machines)
|
||||
setup_pipenets(GLOB.machines)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ SUBSYSTEM_DEF(machines)
|
||||
/datum/controller/subsystem/machines/proc/process_premachines(resumed = 0)
|
||||
/* Literally exists as snowflake for fucking powersinks goddamnit */
|
||||
if(!resumed)
|
||||
src.currentrun = processing_power_items.Copy()
|
||||
src.currentrun = GLOB.processing_power_items.Copy()
|
||||
//cache for sanid speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
while(currentrun.len)
|
||||
@@ -75,9 +75,9 @@ SUBSYSTEM_DEF(machines)
|
||||
currentrun.len--
|
||||
if(!QDELETED(I))
|
||||
if(!I.pwr_drain())
|
||||
processing_power_items.Remove(I)
|
||||
GLOB.processing_power_items.Remove(I)
|
||||
else
|
||||
processing_power_items.Remove(I)
|
||||
GLOB.processing_power_items.Remove(I)
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ SUBSYSTEM_DEF(mobs)
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/mobs/stat_entry()
|
||||
..("P:[mob_list.len]")
|
||||
..("P:[GLOB.mob_list.len]")
|
||||
|
||||
/datum/controller/subsystem/mobs/fire(resumed = 0)
|
||||
var/seconds = wait * 0.1
|
||||
if(!resumed)
|
||||
src.currentrun = mob_list.Copy()
|
||||
src.currentrun = GLOB.mob_list.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
@@ -23,6 +23,6 @@ SUBSYSTEM_DEF(mobs)
|
||||
if(M)
|
||||
M.Life(seconds, times_fired)
|
||||
else
|
||||
mob_list.Remove(M)
|
||||
GLOB.mob_list.Remove(M)
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
@@ -54,7 +54,7 @@ SUBSYSTEM_DEF(nightshift)
|
||||
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
|
||||
else
|
||||
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
|
||||
for(var/A in apcs)
|
||||
for(var/A in GLOB.apcs)
|
||||
var/obj/machinery/power/apc/APC = A
|
||||
if(is_station_level(APC.z))
|
||||
APC.set_nightshift(active)
|
||||
|
||||
@@ -19,7 +19,7 @@ SUBSYSTEM_DEF(weather)
|
||||
var/datum/weather/W = V
|
||||
if(W.aesthetic || W.stage != MAIN_STAGE)
|
||||
continue
|
||||
for(var/i in living_mob_list)
|
||||
for(var/i in GLOB.living_mob_list)
|
||||
var/mob/living/L = i
|
||||
if(W.can_weather_act(L))
|
||||
W.weather_act(L)
|
||||
|
||||
@@ -95,7 +95,7 @@ var/global/list/round_voters = list() //Keeps track of the individuals voting fo
|
||||
choices = sorted_choices
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/non_voters = (clients.len - total_votes)
|
||||
var/non_voters = (GLOB.clients.len - total_votes)
|
||||
if(non_voters > 0)
|
||||
if(mode == "restart")
|
||||
choices["Continue Playing"] += non_voters
|
||||
|
||||
Reference in New Issue
Block a user