mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fix shit
This commit is contained in:
@@ -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
|
||||
@@ -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]'")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]")
|
||||
|
||||
|
||||
@@ -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:"
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]")
|
||||
|
||||
|
||||
@@ -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
|
||||
. = ..()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//Fires five times every second.
|
||||
|
||||
PROCESSING_SUBSYTEM(fastprocess)
|
||||
PROCESSING_SUBSYSTEM(fastprocess)
|
||||
name = "Fast Processing"
|
||||
wait = 2
|
||||
stat_tag = "FP"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
PROCESSING_SUBSYTEM(flightpacks)
|
||||
PROCESSING_SUBSYSTEM(flightpacks)
|
||||
name = "Flightpack Movement"
|
||||
priority = 30
|
||||
wait = 2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROCESSING_SUBSYTEM(obj)
|
||||
SUBSYSTEM(obj)
|
||||
name = "Objects"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
SUBSYTEM(sun)
|
||||
SUBSYSTEM(sun)
|
||||
name = "Sun"
|
||||
wait = 600
|
||||
init_order = 2
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
addtimer(CALLBACK(SSticker, /datum/controller/subsystem/ticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o)
|
||||
@@ -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("<span class='warning'>[M] devours [src]!</span>")
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user