From 7a4f1496e97dbbb46df925d1bca230b3aecc07d6 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 1 May 2017 07:24:45 -0500 Subject: [PATCH] Changes a lot of ticker and ticker.mode checks to SSticker.hasRoundStarted --- code/controllers/subsystem/vote.dm | 2 +- code/datums/mind.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 -- code/game/machinery/doors/door.dm | 2 -- code/game/machinery/doors/windowdoor.dm | 2 -- code/modules/admin/secrets.dm | 4 ++-- code/modules/admin/topic.dm | 10 +++++----- code/modules/admin/topic.dm.rej | 10 ++++++++++ code/modules/admin/verbs/debug.dm | 12 ++++++------ code/modules/admin/verbs/onlyone.dm | 4 ++-- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 4 ++-- code/modules/mob/living/carbon/human/death.dm.rej | 10 ++++++++++ code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/living_defense.dm | 2 +- code/modules/mob/living/silicon/ai/ai_defense.dm | 2 +- code/modules/mob/mob_helpers.dm | 2 +- code/world.dm | 2 +- 18 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 code/modules/admin/topic.dm.rej create mode 100644 code/modules/mob/living/carbon/human/death.dm.rej diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index b3b6dce98a..5deb0adf85 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -124,7 +124,7 @@ SUBSYSTEM_DEF(vote) if("gamemode") if(GLOB.master_mode != .) world.save_mode(.) - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) restart = 1 else GLOB.master_mode = . diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 5a6c34bcc4..9077db63e1 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -255,7 +255,7 @@ to_chat(recipient, "[output]") /datum/mind/proc/edit_memory() - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Not before round-start!", "Alert") return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index a9331cd142..7ff38f53c9 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1283,8 +1283,6 @@ if(!density) return 1 - if(!SSticker || !SSticker.mode) - return 0 operating = 1 update_icon(AIRLOCK_OPENING, 1) src.set_opacity(0) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index cd587a0c44..4e076e3338 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -229,8 +229,6 @@ return 1 if(operating) return - if(!SSticker || !SSticker.mode) - return 0 operating = 1 do_animate("opening") set_opacity(0) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 20dd6860ea..99cdc1adc3 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -129,8 +129,6 @@ /obj/machinery/door/window/open(forced=0) if (src.operating == 1) //doors can still open when emag-disabled return 0 - if(!SSticker || !SSticker.mode) - return 0 if(!forced) if(!hasPower()) return 0 diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 7f0479eac9..a7a42da6d9 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -238,7 +238,7 @@ if("showgm") if(!check_rights(R_ADMIN)) return - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") else if (SSticker.mode) alert("The game mode is [SSticker.mode.name]") @@ -327,7 +327,7 @@ if("traitor_all") if(!check_rights(R_FUN)) return - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") return var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index dd32085681..c05db79983 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1170,7 +1170,7 @@ if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) return alert(usr, "The game has already started.", null, null, null, null) var/dat = {"What mode do you wish to play?
"} for(var/mode in config.modes) @@ -1184,7 +1184,7 @@ if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) @@ -1199,7 +1199,7 @@ if(!check_rights(R_ADMIN|R_SERVER)) return - if (SSticker && SSticker.mode) + if (SSticker.HasRoundStarted()) return alert(usr, "The game has already started.", null, null, null, null) GLOB.master_mode = href_list["c_mode2"] log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].") @@ -1213,7 +1213,7 @@ if(!check_rights(R_ADMIN|R_SERVER)) return - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) @@ -1810,7 +1810,7 @@ if(!check_rights(R_ADMIN)) return - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") return diff --git a/code/modules/admin/topic.dm.rej b/code/modules/admin/topic.dm.rej new file mode 100644 index 0000000000..041ae92107 --- /dev/null +++ b/code/modules/admin/topic.dm.rej @@ -0,0 +1,10 @@ +diff a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm (rejected hunks) +@@ -8,7 +8,7 @@ + if(href_list["ahelp"]) + if(!check_rights(R_ADMIN)) + return +- ++ + var/ahelp_ref = href_list["ahelp"] + var/datum/admin_help/AH = locate(ahelp_ref) + if(AH) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index c9014da3b0..c49240ed66 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -207,7 +207,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Fun" set name = "Make Robot" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return if(ishuman(M)) @@ -223,7 +223,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Fun" set name = "Make Blob" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return if(ishuman(M)) @@ -241,7 +241,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Fun" set name = "Make Simple Animal" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return @@ -289,7 +289,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Fun" set name = "Make Alien" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return if(ishuman(M)) @@ -306,7 +306,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Fun" set name = "Make slime" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return if(ishuman(M)) @@ -417,7 +417,7 @@ GLOBAL_PROTECT(AdminProcCall) set category = "Admin" set name = "Grant Full Access" - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("Wait until the game starts") return if(ishuman(M)) diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index dd56f2a6a0..37dab65b0c 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -1,6 +1,6 @@ GLOBAL_VAR_INIT(highlander, FALSE) /client/proc/only_one() //Gives everyone kilts, berets, claymores, and pinpointers, with the objective to hijack the emergency shuttle. - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") return GLOB.highlander = TRUE @@ -79,7 +79,7 @@ GLOBAL_VAR_INIT(highlander, FALSE) Activate it in your hand, and it will lead to the nearest target. Attack the nuclear authentication disk with it, and you will store it.") /proc/only_me() - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) alert("The game hasn't started yet!") return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index f4dcc36576..04cf3e855a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -701,7 +701,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Make Everyone Random" set desc = "Make everyone have a random appearance. You can only use this before rounds!" - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!") return diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ab6377b096..7d05d15624 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -298,7 +298,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/Stat() ..() if(statpanel("Status")) - if(SSticker && SSticker.mode) + if(SSticker.HasRoundStarted()) for(var/datum/gang/G in SSticker.mode.gangs) if(G.is_dominating) stat(null, "[G.name] Gang Takeover: [max(G.domination_time_remaining(), 0)]") @@ -361,7 +361,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!A.hidden) filtered += A var/area/thearea = input("Area to jump to", "BOOYEA") as null|anything in filtered - + if(!thearea) return diff --git a/code/modules/mob/living/carbon/human/death.dm.rej b/code/modules/mob/living/carbon/human/death.dm.rej new file mode 100644 index 0000000000..a4a1fc5a7c --- /dev/null +++ b/code/modules/mob/living/carbon/human/death.dm.rej @@ -0,0 +1,10 @@ +diff a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm (rejected hunks) +@@ -32,7 +32,7 @@ + + dna.species.spec_death(gibbed, src) + +- if(SSticker && SSticker.mode) ++ if(SSticker.HasRoundStarted()) + SSblackbox.ReportDeath(src) + if(mind && mind.devilinfo) + INVOKE_ASYNC(mind.devilinfo, /datum/devilinfo.proc/beginResurrectionCheck, src) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e3502e7a90..d707f01e60 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -600,7 +600,7 @@ return name /mob/living/update_gravity(has_gravity,override = 0) - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) return if(has_gravity) clear_alert("weightless") diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 6ea921e560..e4129e642d 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -172,7 +172,7 @@ /mob/living/attack_slime(mob/living/simple_animal/slime/M) - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) to_chat(M, "You cannot attack people before the game has started.") return diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 75ef88768f..d07f85ef6a 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -6,7 +6,7 @@ /mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M) - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) to_chat(M, "You cannot attack people before the game has started.") return ..() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 834d799b79..65e83d3c5d 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -326,7 +326,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 0 /proc/is_special_character(mob/M) // returns 1 for special characters and 2 for heroes of gamemode //moved out of admins.dm because things other than admin procs were calling this. - if(!SSticker || !SSticker.mode) + if(!SSticker.HasRoundStarted()) return 0 if(!istype(M)) return 0 diff --git a/code/world.dm b/code/world.dm index 7af27a1504..c3ded147f2 100644 --- a/code/world.dm +++ b/code/world.dm @@ -116,7 +116,7 @@ s["map_name"] = SSmapping.config.map_name - if(key_valid && SSticker && SSticker.mode) + if(key_valid && SSticker.HasRoundStarted()) s["real_mode"] = SSticker.mode.name // Key-authed callers may know the truth behind the "secret"