From a801187edea18d363d027bfd439c6f73aeb19212 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 22 Mar 2017 12:11:59 -0400 Subject: [PATCH] Fix shit --- code/__DEFINES/MC.dm | 6 +++--- code/controllers/master.dm | 16 ++++++++-------- code/controllers/subsystem.dm | 1 + code/controllers/subsystem/augury.dm | 3 --- code/controllers/subsystem/communications.dm | 3 --- code/controllers/subsystem/fire_burning.dm | 4 ---- code/controllers/subsystem/garbage.dm | 3 --- code/controllers/subsystem/icon_smooth.dm | 3 --- code/controllers/subsystem/inbounds.dm | 2 -- code/controllers/subsystem/ipintel.dm | 3 --- .../subsystem/processing/fastprocess.dm | 2 +- .../subsystem/processing/flightpacks.dm | 2 +- code/controllers/subsystem/processing/obj.dm | 2 +- code/controllers/subsystem/server_maint.dm | 3 --- code/controllers/subsystem/sun.dm | 2 +- code/controllers/subsystem/vote.dm | 3 --- code/modules/events/wizard/fakeexplosion.dm | 2 +- .../mob/living/simple_animal/hostile/mushroom.dm | 8 ++++---- 18 files changed, 21 insertions(+), 47 deletions(-) diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index ce4935a6e196..cd1f9ec1be89 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -3,7 +3,7 @@ #define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current)) #define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current)) #define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current)) -#define NEW_SS_GLOBAL2(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} +#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} #define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = 1;Processor.processing += Datum} #define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = 0;Processor.processing -= Datum @@ -70,14 +70,14 @@ #define SUBSYSTEM(X) var/datum/controller/subsystem/##X/SS##X;\ /datum/controller/subsystem/##X/New(){\ + NEW_SS_GLOBAL(SS##X);\ ..();\ - NEW_SS_GLOBAL2(SS##X);\ }\ /datum/controller/subsystem/##X #define PROCESSING_SUBSYSTEM(X) var/datum/controller/subsystem/processing/##X/SS##X;\ /datum/controller/subsystem/processing/##X/New(){\ + NEW_SS_GLOBAL(SS##X);\ ..();\ - NEW_SS_GLOBAL2(SS##X);\ }\ /datum/controller/subsystem/processing/##X \ No newline at end of file diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 26801cff439d..636e1d2f86dc 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -348,7 +348,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING var/tick_precentage var/tick_remaining var/ran = TRUE //this is right - var/ran_non_SSticker = FALSE + var/ran_non_ticker = FALSE var/bg_calc //have we swtiched current_tick_budget to background mode yet? var/tick_usage @@ -372,7 +372,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING //(unless we haven't even ran anything this tick, since its unlikely they will ever be able run // in those cases, so we just let them run) if (queue_node_flags & SS_NO_TICK_CHECK) - if (queue_node.tick_usage > TICK_LIMIT_RUNNING - world.tick_usage && ran_non_SSticker) + if (queue_node.tick_usage > TICK_LIMIT_RUNNING - world.tick_usage && ran_non_ticker) queue_node.queued_priority += queue_priority_count * 0.10 queue_priority_count -= queue_node_priority queue_priority_count += queue_node.queued_priority @@ -394,7 +394,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING CURRENT_TICKLIMIT = world.tick_usage + tick_precentage if (!(queue_node_flags & SS_TICKER)) - ran_non_SSticker = TRUE + ran_non_ticker = TRUE ran = TRUE tick_usage = world.tick_usage queue_node_paused = (queue_node.state == SS_PAUSED || queue_node.state == SS_PAUSING) @@ -456,20 +456,20 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING //resets the queue, and all subsystems, while filtering out the subsystem lists // called if any mc's queue procs runtime or exit improperly. -/datum/controller/master/proc/SoftReset(list/SSticker_SS, list/normal_SS, list/lobby_SS) +/datum/controller/master/proc/SoftReset(list/ticker_SS, list/normal_SS, list/lobby_SS) . = 0 log_world("MC: SoftReset called, resetting MC queue state.") - if (!istype(subsystems) || !istype(SSticker_SS) || !istype(normal_SS) || !istype(lobby_SS)) - log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[SSticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!") + if (!istype(subsystems) || !istype(ticker_SS) || !istype(normal_SS) || !istype(lobby_SS)) + log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!") return - var/subsystemstocheck = subsystems + SSticker_SS + normal_SS + lobby_SS + var/subsystemstocheck = subsystems + ticker_SS + normal_SS + lobby_SS for (var/thing in subsystemstocheck) var/datum/controller/subsystem/SS = thing if (!SS || !istype(SS)) //list(SS) is so if a list makes it in the subsystem list, we remove the list, not the contents subsystems -= list(SS) - SSticker_SS -= list(SS) + ticker_SS -= list(SS) normal_SS -= list(SS) lobby_SS -= list(SS) log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'") diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 2a1caed3119a..c165baafb352 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -34,6 +34,7 @@ PreInit() // Used to initialize the subsystem BEFORE the map has loaded +// Called AFTER Recover if that is called // Prefer to use Initialize if possible /datum/controller/subsystem/proc/PreInit() return diff --git a/code/controllers/subsystem/augury.dm b/code/controllers/subsystem/augury.dm index af05e95af2a7..bd0c649f64b4 100644 --- a/code/controllers/subsystem/augury.dm +++ b/code/controllers/subsystem/augury.dm @@ -7,9 +7,6 @@ SUBSYSTEM(augury) var/list/observers_given_action = list() -/datum/controller/subsystem/augury/New() - NEW_SS_GLOBAL(SSaugury) - /datum/controller/subsystem/augury/stat_entry(msg) ..("W:[watchers.len]|D:[doombringers.len]") diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index 3024ef3a06d8..0b550ad661e2 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -8,9 +8,6 @@ SUBSYSTEM(communications) var/silicon_message_cooldown var/nonsilicon_message_cooldown -/datum/controller/subsystem/communications/New() - NEW_SS_GLOBAL(SScommunications) - /datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon) if(is_silicon && silicon_message_cooldown > world.time) . = FALSE diff --git a/code/controllers/subsystem/fire_burning.dm b/code/controllers/subsystem/fire_burning.dm index 1f89330bdce5..c2983ffe9ce9 100644 --- a/code/controllers/subsystem/fire_burning.dm +++ b/code/controllers/subsystem/fire_burning.dm @@ -6,10 +6,6 @@ SUBSYSTEM(fire_burning) var/list/currentrun = list() var/list/processing = list() -/datum/controller/subsystem/fire_burning/New() - NEW_SS_GLOBAL(SSfire_burning) - - /datum/controller/subsystem/fire_burning/stat_entry() ..("P:[processing.len]") diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 83f166019a2d..37418d4c4b27 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -32,9 +32,6 @@ SUBSYSTEM(garbage) var/list/qdel_list = list() // list of all types that have been qdel()eted #endif -/datum/controller/subsystem/garbage/New() - NEW_SS_GLOBAL(SSgarbage) - /datum/controller/subsystem/garbage/stat_entry(msg) msg += "Q:[queue.len]|D:[delslasttick]|G:[gcedlasttick]|" msg += "GR:" diff --git a/code/controllers/subsystem/icon_smooth.dm b/code/controllers/subsystem/icon_smooth.dm index 509cb285d7c9..cd751635c0ff 100644 --- a/code/controllers/subsystem/icon_smooth.dm +++ b/code/controllers/subsystem/icon_smooth.dm @@ -7,9 +7,6 @@ SUBSYSTEM(icon_smooth) var/list/smooth_queue = list() -/datum/controller/subsystem/icon_smooth/New() - NEW_SS_GLOBAL(SSicon_smooth) - /datum/controller/subsystem/icon_smooth/fire() while(smooth_queue.len) var/atom/A = smooth_queue[smooth_queue.len] diff --git a/code/controllers/subsystem/inbounds.dm b/code/controllers/subsystem/inbounds.dm index 9db1af683acd..5c7926c6290d 100644 --- a/code/controllers/subsystem/inbounds.dm +++ b/code/controllers/subsystem/inbounds.dm @@ -6,8 +6,6 @@ SUBSYSTEM(inbounds) var/list/processing = list() var/list/currentrun = list() -/datum/controller/subsystem/inbounds/New() - NEW_SS_GLOBAL(SSinbounds) /datum/controller/subsystem/inbounds/stat_entry() ..("P:[processing.len]") diff --git a/code/controllers/subsystem/ipintel.dm b/code/controllers/subsystem/ipintel.dm index 9910270cdc40..ef60269a90d5 100644 --- a/code/controllers/subsystem/ipintel.dm +++ b/code/controllers/subsystem/ipintel.dm @@ -8,9 +8,6 @@ SUBSYSTEM(ipintel) var/list/cache = list() -/datum/controller/subsystem/ipintel/New() - NEW_SS_GLOBAL(SSipintel) - /datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel) enabled = 1 . = ..() diff --git a/code/controllers/subsystem/processing/fastprocess.dm b/code/controllers/subsystem/processing/fastprocess.dm index 3d87eab340b4..535cc3ea821e 100644 --- a/code/controllers/subsystem/processing/fastprocess.dm +++ b/code/controllers/subsystem/processing/fastprocess.dm @@ -1,6 +1,6 @@ //Fires five times every second. -PROCESSING_SUBSYTEM(fastprocess) +PROCESSING_SUBSYSTEM(fastprocess) name = "Fast Processing" wait = 2 stat_tag = "FP" diff --git a/code/controllers/subsystem/processing/flightpacks.dm b/code/controllers/subsystem/processing/flightpacks.dm index 753eb5042f0c..f81c954a250e 100644 --- a/code/controllers/subsystem/processing/flightpacks.dm +++ b/code/controllers/subsystem/processing/flightpacks.dm @@ -1,5 +1,5 @@ -PROCESSING_SUBSYTEM(flightpacks) +PROCESSING_SUBSYSTEM(flightpacks) name = "Flightpack Movement" priority = 30 wait = 2 diff --git a/code/controllers/subsystem/processing/obj.dm b/code/controllers/subsystem/processing/obj.dm index 85d2fbb0301d..5b8d251fa9bd 100644 --- a/code/controllers/subsystem/processing/obj.dm +++ b/code/controllers/subsystem/processing/obj.dm @@ -1,4 +1,4 @@ -PROCESSING_SUBSYTEM(obj) +SUBSYSTEM(obj) name = "Objects" priority = 40 flags = SS_NO_INIT diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm index eca1065588a6..9794172d0206 100644 --- a/code/controllers/subsystem/server_maint.dm +++ b/code/controllers/subsystem/server_maint.dm @@ -3,9 +3,6 @@ SUBSYSTEM(server_maint) wait = 6000 flags = SS_NO_TICK_CHECK -/datum/controller/subsystem/server_maint/New() - NEW_SS_GLOBAL(SSserver) - /datum/controller/subsystem/server_maint/Initialize(timeofday) if (config.hub) world.visibility = 1 diff --git a/code/controllers/subsystem/sun.dm b/code/controllers/subsystem/sun.dm index 24fee1aaf5a3..e27a292eda28 100644 --- a/code/controllers/subsystem/sun.dm +++ b/code/controllers/subsystem/sun.dm @@ -1,4 +1,4 @@ -SUBSYTEM(sun) +SUBSYSTEM(sun) name = "Sun" wait = 600 init_order = 2 diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 6c7d981f0b04..2d4201a0bfc2 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -14,9 +14,6 @@ SUBSYSTEM(vote) var/list/voting = list() var/list/generated_actions = list() -/datum/controller/subsystem/vote/New() - NEW_SS_GLOBAL(SSvote) - /datum/controller/subsystem/vote/fire() //called by master_controller if(mode) time_remaining = round((started_time + config.vote_period - world.time)/10) diff --git a/code/modules/events/wizard/fakeexplosion.dm b/code/modules/events/wizard/fakeexplosion.dm index 1f4daf03ca0a..10892f2132c4 100644 --- a/code/modules/events/wizard/fakeexplosion.dm +++ b/code/modules/events/wizard/fakeexplosion.dm @@ -8,4 +8,4 @@ /datum/round_event/wizard/fake_explosion/start() for(var/mob/M in player_list) M << 'sound/machines/Alarm.ogg' - addtimer(CALLBACK(SSticker, /datum/controller/subsystem/SSticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o) \ No newline at end of file + addtimer(CALLBACK(SSticker, /datum/controller/subsystem/ticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 9ff3de2e1b2a..94941a0508eb 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -32,7 +32,7 @@ var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight - var/faint_SSticker = 0 //If we hit three, another mushroom's gonna eat us + var/faint_ticker = 0 //If we hit three, another mushroom's gonna eat us var/image/cap_living = null //Where we store our cap icons so we dont generate them constantly to update our icon var/image/cap_dead = null @@ -74,9 +74,9 @@ /mob/living/simple_animal/hostile/mushroom/attack_animal(mob/living/L) if(istype(L, /mob/living/simple_animal/hostile/mushroom) && stat == DEAD) var/mob/living/simple_animal/hostile/mushroom/M = L - if(faint_SSticker < 2) + if(faint_ticker < 2) M.visible_message("[M] chews a bit on [src].") - faint_SSticker++ + faint_ticker++ return M.visible_message("[M] devours [src]!") var/level_gain = (powerlevel - M.powerlevel) @@ -107,7 +107,7 @@ /mob/living/simple_animal/hostile/mushroom/proc/Recover() visible_message("[src] slowly begins to recover.") - faint_SSticker = 0 + faint_ticker = 0 revive(full_heal = 1) UpdateMushroomCap() recovery_cooldown = 1