diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 6fd41f7ea1..6bc79fb7d5 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -513,7 +513,7 @@ winset(C, "mainwindow", "flash=5") /proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank) - if(SSticker.current_state != GAME_STATE_PLAYING || !character) + if(!SSticker.IsRoundInProgress() || !character) return var/area/A = get_area(character) var/message = "\ diff --git a/code/controllers/master.dm b/code/controllers/master.dm index ab4ff43b04..01d0ac3447 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -48,7 +48,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) var/initializations_finished_with_no_players_logged_in //I wonder what this could be? // Has round started? (So we know what subsystems to run) - var/round_started = 0 + var/local_round_started = FALSE //Don't read this var, use SSticker.HasRoundStarted() instead // The type of the last subsystem to be process()'d. var/last_type_processed @@ -189,7 +189,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) // Notify the MC that the round has started. /datum/controller/master/proc/RoundStart() - round_started = 1 + local_round_started = TRUE var/timer = world.time for (var/datum/controller/subsystem/SS in subsystems) if (SS.flags & SS_FIRE_IN_LOBBY || SS.flags & SS_TICKER) @@ -222,7 +222,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) // local vars rock // Schedule the first run of the Subsystems. - round_started = world.has_round_started() + local_round_started = world.has_round_started() //all this shit is here so that flag edits can be refreshed by restarting the MC. (and for speed) var/list/tickersubsystems = list() var/list/normalsubsystems = list() @@ -245,7 +245,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) lobbysubsystems += SS timer += world.tick_lag * rand(1, 5) SS.next_fire = timer - else if (round_started) + else if (local_round_started) timer += world.tick_lag * rand(1, 5) SS.next_fire = timer normalsubsystems += SS @@ -296,7 +296,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) if (!Failsafe || (Failsafe.processing_interval > 0 && (Failsafe.lasttick+(Failsafe.processing_interval*5)) < world.time)) new/datum/controller/failsafe() // (re)Start the failsafe. if (!queue_head || !(iteration % 3)) - if (round_started) + if (local_round_started) subsystems_to_check = normalsubsystems else subsystems_to_check = lobbysubsystems diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index f701c051da..305dbc0678 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -243,7 +243,7 @@ SUBSYSTEM_DEF(ticker) send2irc("Server", "Round of [hide_mode ? "secret":"[mode.name]"] has started[allmins.len ? ".":" with no active admins online!"]") /datum/controller/subsystem/ticker/proc/OnRoundstart(datum/callback/cb) - if(current_state < GAME_STATE_PLAYING) + if(!HasRoundStarted()) LAZYADD(round_start_events, cb) else cb.InvokeAsync() diff --git a/code/controllers/subsystem/ticker.dm.rej b/code/controllers/subsystem/ticker.dm.rej new file mode 100644 index 0000000000..1dbd2f038a --- /dev/null +++ b/code/controllers/subsystem/ticker.dm.rej @@ -0,0 +1,17 @@ +diff a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm (rejected hunks) +@@ -667,11 +667,11 @@ SUBSYSTEM_DEF(ticker) + return + INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate) + ++/datum/controller/subsystem/ticker/proc/HasRoundStarted() ++ return current_state >= GAME_STATE_PLAYING + +-/world/proc/has_round_started() +- if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING) +- return TRUE +- return FALSE ++/datum/controller/subsystem/ticker/proc/IsRoundInProgress() ++ return current_state == GAME_STATE_PLAYING + + /datum/controller/subsystem/ticker/Recover() + current_state = SSticker.current_state diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index f1b5d3a973..628949ebc0 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -89,7 +89,7 @@ to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes") to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes") if(config.show_game_type_odds) - if(SSticker.current_state == GAME_STATE_PLAYING) + if(SSticker.IsRoundInProgress()) var/prob_sum = 0 var/current_odds_differ = FALSE var/list/probs = list() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index c082a48224..6ac0ab8c7c 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -654,7 +654,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) for(var/mob/dead/new_player/P in GLOB.player_list) if(P.client && P.ready && P.mind!=owner) n_p ++ - else if (SSticker.current_state == GAME_STATE_PLAYING) + else if (SSticker.IsRoundInProgress()) for(var/mob/living/carbon/human/P in GLOB.player_list) if(P.client && !(P.mind in SSticker.mode.changelings) && P.mind!=owner) n_p ++ diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 10eefc4b14..ffcf98ca09 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -397,7 +397,7 @@ /turf/proc/add_blueprints_preround(atom/movable/AM) - if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING) + if(!SSticker.HasRoundStarted()) add_blueprints(AM) /turf/proc/empty(turf_type=/turf/open/space) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 25b7deba9b..f4e7cccff4 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -804,7 +804,7 @@ return 1 /client/proc/adminGreet(logout) - if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) + if(SSticker.HasRoundStarted()) var/string if(logout && config && config.announce_admin_logout) string = pick( diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index bfa8553d52..09aced33a8 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -310,7 +310,7 @@ usr << browse(dat, "window=players;size=600x480") /datum/admins/proc/check_antagonists() - if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING) + if (SSticker.HasRoundStarted()) var/dat = "Round Status

Round Status

" if(SSticker.mode.replacementmode) dat += "Former Game Mode: [SSticker.mode.name]
" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index dd32085681..7210b4e625 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2161,7 +2161,7 @@ else if(href_list["kick_all_from_lobby"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) + if(SSticker.IsRoundInProgress()) var/afkonly = text2num(href_list["afkonly"]) if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message","Yes","Cancel") != "Yes") to_chat(usr, "Kick clients from lobby aborted") diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index 996b4a700b..93b9b6b3f9 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -206,7 +206,7 @@ toggle_all_ctf(user) return - if(SSticker.current_state < GAME_STATE_PLAYING) + if(!SSticker.HasRoundStarted()) return if(user.ckey in team_members) if(user.ckey in recently_dead_ckeys) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index d9663f97c9..96c0bc35de 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -22,7 +22,7 @@ anchored = 1 /obj/effect/mob_spawn/attack_ghost(mob/user) - if(SSticker.current_state != GAME_STATE_PLAYING || !loc) + if(!SSticker.HasRoundStarted() || !loc) return if(!uses) to_chat(user, "This spawner is out of charges!") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 72f83bf546..d2ef3097cf 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -148,7 +148,7 @@ return 1 if(href_list["late_join"]) - if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING) + if(!SSticker || !SSticker.IsRoundInProgress()) to_chat(usr, "The round is either not ready, or has already finished...") return diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index d87573edd3..1211370b94 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -337,7 +337,7 @@ . = 1 /mob/living/simple_animal/proc/make_babies() // <3 <3 <3 - if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || SSticker.current_state != GAME_STATE_PLAYING) + if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress()) return next_scan_time = world.time + 400 var/alone = 1 diff --git a/code/modules/mob/logout.dm.rej b/code/modules/mob/logout.dm.rej new file mode 100644 index 0000000000..809131d9f4 --- /dev/null +++ b/code/modules/mob/logout.dm.rej @@ -0,0 +1,10 @@ +diff a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm (rejected hunks) +@@ -3,7 +3,7 @@ + unset_machine() + GLOB.player_list -= src + if(GLOB.admin_datums[src.ckey]) +- if (SSticker && SSticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. ++ if (SSticker && SSticker.IsRoundInProgress()) //Only report this stuff if we are currently playing. + var/admins_number = GLOB.admins.len + if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell. + var/cheesy_message = pick( list( \ diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 7a5abbbba4..6ca3c8f620 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -304,7 +304,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne // Sound the alert if gravity was just enabled or disabled. var/alert = 0 var/area/area = get_area(src) - if(on && SSticker && SSticker.current_state == GAME_STATE_PLAYING) // If we turned on and the game is live. + if(on && SSticker.IsRoundInProgress()) // If we turned on and the game is live. if(gravity_in_level() == 0) alert = 1 investigate_log("was brought online and is now producing gravity for this level.", "gravity") diff --git a/code/modules/power/singularity/emitter.dm.rej b/code/modules/power/singularity/emitter.dm.rej new file mode 100644 index 0000000000..ea82e4cb0c --- /dev/null +++ b/code/modules/power/singularity/emitter.dm.rej @@ -0,0 +1,10 @@ +diff a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm (rejected hunks) +@@ -88,7 +88,7 @@ + connect_to_network() + + /obj/machinery/power/emitter/Destroy() +- if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) ++ if(SSticker && SSticker.IsRoundInProgress()) + message_admins("Emitter deleted at ([x],[y],[z] - JMP)",0,1) + log_game("Emitter deleted at ([x],[y],[z])") + investigate_log("deleted at ([x],[y],[z]) at [get_area(src)]","singulo") diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index fdb4699ae5..1e1737661e 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -191,7 +191,7 @@ cell.charge = (charge / capacity) * cell.maxcharge /obj/machinery/power/smes/Destroy() - if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) + if(SSticker && SSticker.IsRoundInProgress()) var/area/area = get_area(src) message_admins("SMES deleted at ([area.name])") log_game("SMES deleted at ([area.name])") diff --git a/code/world.dm b/code/world.dm index 7af27a1504..0a7391ba62 100644 --- a/code/world.dm +++ b/code/world.dm @@ -317,3 +317,6 @@ s += ": [jointext(features, ", ")]" status = s + +/world/proc/has_round_started() + return SSticker.HasRoundStarted() \ No newline at end of file