Bools and returns super-pr (#53221) (#565)

Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
This commit is contained in:
SkyratBot
2020-08-30 05:12:59 +02:00
committed by GitHub
co-authored by TiviPlus <TiviPlus> Couls TiviPlus
parent f600605607
commit ec09510459
355 changed files with 1549 additions and 1591 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ SUBSYSTEM_DEF(acid)
return ..()
/datum/controller/subsystem/acid/fire(resumed = 0)
/datum/controller/subsystem/acid/fire(resumed = FALSE)
if (!resumed)
src.currentrun = processing.Copy()
+18 -18
View File
@@ -70,7 +70,7 @@ SUBSYSTEM_DEF(air)
return ..()
/datum/controller/subsystem/air/fire(resumed = 0)
/datum/controller/subsystem/air/fire(resumed = FALSE)
var/timer = TICK_USAGE_REAL
if(currentpart == SSAIR_REBUILD_PIPENETS)
@@ -90,7 +90,7 @@ SUBSYSTEM_DEF(air)
cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_ATMOSMACHINERY
if(currentpart == SSAIR_ATMOSMACHINERY)
@@ -99,7 +99,7 @@ SUBSYSTEM_DEF(air)
cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_ACTIVETURFS
if(currentpart == SSAIR_ACTIVETURFS)
@@ -108,7 +108,7 @@ SUBSYSTEM_DEF(air)
cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_EXCITEDGROUPS
if(currentpart == SSAIR_EXCITEDGROUPS)
@@ -117,7 +117,7 @@ SUBSYSTEM_DEF(air)
cost_groups = MC_AVERAGE(cost_groups, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_HIGHPRESSURE
if(currentpart == SSAIR_HIGHPRESSURE)
@@ -126,7 +126,7 @@ SUBSYSTEM_DEF(air)
cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_HOTSPOTS
if(currentpart == SSAIR_HOTSPOTS)
@@ -135,7 +135,7 @@ SUBSYSTEM_DEF(air)
cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_SUPERCONDUCTIVITY
if(currentpart == SSAIR_SUPERCONDUCTIVITY)
@@ -144,13 +144,13 @@ SUBSYSTEM_DEF(air)
cost_superconductivity = MC_AVERAGE(cost_superconductivity, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
resumed = FALSE
currentpart = SSAIR_REBUILD_PIPENETS
SStgui.update_uis(SSair) //Lightning fast debugging motherfucker
/datum/controller/subsystem/air/proc/process_pipenets(resumed = 0)
/datum/controller/subsystem/air/proc/process_pipenets(resumed = FALSE)
if (!resumed)
src.currentrun = networks.Copy()
//cache for sanic speed (lists are references anyways)
@@ -169,7 +169,7 @@ SUBSYSTEM_DEF(air)
if(istype(atmos_machine, /obj/machinery/atmospherics))
pipenets_needing_rebuilt += atmos_machine
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = 0)
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = FALSE)
var/seconds = wait * 0.1
if (!resumed)
src.currentrun = atmos_machinery.Copy()
@@ -184,7 +184,7 @@ SUBSYSTEM_DEF(air)
return
/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = 0)
/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = FALSE)
if (!resumed)
src.currentrun = active_super_conductivity.Copy()
//cache for sanic speed (lists are references anyways)
@@ -196,7 +196,7 @@ SUBSYSTEM_DEF(air)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_hotspots(resumed = 0)
/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
if (!resumed)
src.currentrun = hotspots.Copy()
//cache for sanic speed (lists are references anyways)
@@ -212,7 +212,7 @@ SUBSYSTEM_DEF(air)
return
/datum/controller/subsystem/air/proc/process_high_pressure_delta(resumed = 0)
/datum/controller/subsystem/air/proc/process_high_pressure_delta(resumed = FALSE)
while (high_pressure_delta.len)
var/turf/open/T = high_pressure_delta[high_pressure_delta.len]
high_pressure_delta.len--
@@ -221,7 +221,7 @@ SUBSYSTEM_DEF(air)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0)
/datum/controller/subsystem/air/proc/process_active_turfs(resumed = FALSE)
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
@@ -236,7 +236,7 @@ SUBSYSTEM_DEF(air)
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = FALSE)
if (!resumed)
src.currentrun = excited_groups.Copy()
//cache for sanic speed (lists are references anyways)
@@ -262,7 +262,7 @@ SUBSYSTEM_DEF(air)
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, COLOR_VIBRANT_LIME)
#endif
if(istype(T))
T.excited = 0
T.excited = FALSE
if(T.excited_group)
T.excited_group.garbage_collect()
@@ -271,7 +271,7 @@ SUBSYSTEM_DEF(air)
#ifdef VISUALIZE_ACTIVE_TURFS
T.add_atom_colour(COLOR_VIBRANT_LIME, TEMPORARY_COLOUR_PRIORITY)
#endif
T.excited = 1
T.excited = TRUE
active_turfs |= T
if(currentpart == SSAIR_ACTIVETURFS)
currentrun |= T
@@ -370,7 +370,7 @@ SUBSYSTEM_DEF(air)
else
EG.add_turf(ET)
if (!ET.excited)
ET.excited = 1
ET.excited = TRUE
. += ET
/turf/open/space/resolve_active_graph()
return list()
+3 -3
View File
@@ -42,14 +42,14 @@ SUBSYSTEM_DEF(discord)
var/list/reverify_cache = list()
var/notify_file = file("data/notify.json")
/// Is TGS enabled (If not we won't fire because otherwise this is useless)
var/enabled = 0
var/enabled = FALSE
/datum/controller/subsystem/discord/Initialize(start_timeofday)
// Check for if we are using TGS, otherwise return and disables firing
if(world.TgsAvailable())
enabled = 1 // Allows other procs to use this (Account linking, etc)
enabled = TRUE // Allows other procs to use this (Account linking, etc)
else
can_fire = 0 // We dont want excess firing
can_fire = FALSE // We dont want excess firing
return ..() // Cancel
try
+1 -1
View File
@@ -25,7 +25,7 @@ SUBSYSTEM_DEF(events)
return ..()
/datum/controller/subsystem/events/fire(resumed = 0)
/datum/controller/subsystem/events/fire(resumed = FALSE)
if(!resumed)
checkEvent() //only check these if we aren't resuming a paused fire
src.currentrun = running.Copy()
+2 -2
View File
@@ -2,13 +2,13 @@ SUBSYSTEM_DEF(ipintel)
name = "XKeyScore"
init_order = INIT_ORDER_XKEYSCORE
flags = SS_NO_FIRE
var/enabled = 0 //disable at round start to avoid checking reconnects
var/enabled = FALSE //disable at round start to avoid checking reconnects
var/throttle = 0
var/errors = 0
var/list/cache = list()
/datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel)
enabled = 1
enabled = TRUE
. = ..()
+8 -8
View File
@@ -45,7 +45,7 @@ SUBSYSTEM_DEF(job)
var/list/all_jobs = subtypesof(/datum/job)
if(!all_jobs.len)
to_chat(world, "<span class='boldannounce'>Error setting up jobs, no job datums found</span>")
return 0
return FALSE
for(var/J in all_jobs)
var/datum/job/job = new J()
@@ -62,7 +62,7 @@ SUBSYSTEM_DEF(job)
name_occupations[job.title] = job
type_occupations[J] = job
return 1
return TRUE
/datum/controller/subsystem/job/proc/GetJob(rank)
@@ -189,8 +189,8 @@ SUBSYSTEM_DEF(job)
continue
var/mob/dead/new_player/candidate = pick(candidates)
if(AssignRole(candidate, command_position))
return 1
return 0
return TRUE
return FALSE
//This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level
@@ -209,10 +209,10 @@ SUBSYSTEM_DEF(job)
AssignRole(candidate, command_position)
/datum/controller/subsystem/job/proc/FillAIPosition()
var/ai_selected = 0
var/ai_selected = FALSE
var/datum/job/job = GetJob("AI")
if(!job)
return 0
return FALSE
for(var/i = job.total_positions, i > 0, i--)
for(var/level in level_order)
var/list/candidates = list()
@@ -223,8 +223,8 @@ SUBSYSTEM_DEF(job)
ai_selected++
break
if(ai_selected)
return 1
return 0
return TRUE
return FALSE
/** Proc DivideOccupations
+1 -1
View File
@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(machines)
return ..()
/datum/controller/subsystem/machines/fire(resumed = 0)
/datum/controller/subsystem/machines/fire(resumed = FALSE)
if (!resumed)
for(var/datum/powernet/Powernet in powernets)
Powernet.reset() //reset the power state.
+1 -1
View File
@@ -24,7 +24,7 @@ SUBSYSTEM_DEF(mobs)
dead_players_by_zlevel.len++
dead_players_by_zlevel[dead_players_by_zlevel.len] = list()
/datum/controller/subsystem/mobs/fire(resumed = 0)
/datum/controller/subsystem/mobs/fire(resumed = FALSE)
var/seconds = wait * 0.1
if (!resumed)
src.currentrun = GLOB.mob_living_list.Copy()
+2 -2
View File
@@ -68,7 +68,7 @@ SUBSYSTEM_DEF(pai)
if("submit")
if(candidate)
candidate.ready = 1
candidate.ready = TRUE
for(var/obj/item/paicard/p in pai_card_list)
if(!p.pai)
p.alertUpdate()
@@ -195,4 +195,4 @@ SUBSYSTEM_DEF(pai)
var/description
var/role
var/comments
var/ready = 0
var/ready = FALSE
@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(processing)
msg = "[stat_tag]:[length(processing)]"
return ..()
/datum/controller/subsystem/processing/fire(resumed = 0)
/datum/controller/subsystem/processing/fire(resumed = FALSE)
if (!resumed)
currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
@@ -34,5 +34,5 @@ SUBSYSTEM_DEF(processing)
///This proc is called on a datum if it is being processed in a subsystem. If you override this do not call parent, as it will return PROCESS_KILL. This is done to prevent objects that dont override process() from staying in the processing list
/datum/proc/process()
set waitfor = 0
set waitfor = FALSE
return PROCESS_KILL
+2 -2
View File
@@ -303,7 +303,7 @@ SUBSYSTEM_DEF(shuttle)
if (!SSticker.IsRoundInProgress())
return
var/callShuttle = 1
var/callShuttle = TRUE
for(var/thing in GLOB.shuttle_caller_list)
if(isAI(thing))
@@ -319,7 +319,7 @@ SUBSYSTEM_DEF(shuttle)
var/turf/T = get_turf(thing)
if(T && is_station_level(T.z))
callShuttle = 0
callShuttle = FALSE
break
if(callShuttle)
+1 -1
View File
@@ -13,7 +13,7 @@ SUBSYSTEM_DEF(spacedrift)
return ..()
/datum/controller/subsystem/spacedrift/fire(resumed = 0)
/datum/controller/subsystem/spacedrift/fire(resumed = FALSE)
if (!resumed)
src.currentrun = processing.Copy()
+1 -1
View File
@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(tgui)
msg = "P:[length(open_uis)]"
return ..()
/datum/controller/subsystem/tgui/fire(resumed = 0)
/datum/controller/subsystem/tgui/fire(resumed = FALSE)
if(!resumed)
src.current_run = open_uis.Copy()
// Cache for sanic speed (lists are references anyways)
+6 -6
View File
@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(ticker)
var/start_immediately = FALSE
var/setup_done = FALSE //All game setup done including mode post setup and
var/hide_mode = 0
var/hide_mode = FALSE
var/datum/game_mode/mode = null
var/login_music //music played in pregame lobby
@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(ticker)
var/list/datum/mind/minds = list() //The characters in the game. Used for objective tracking.
var/delay_end = 0 //if set true, the round will not restart on it's own
var/delay_end = FALSE //if set true, the round will not restart on it's own
var/admin_delay_notice = "" //a message to display to anyone who tries to restart the world after a delay
var/ready_for_reboot = FALSE //all roundend preparation done with, all that's left is reboot
@@ -32,7 +32,7 @@ SUBSYSTEM_DEF(ticker)
///Boolean to see if the game needs to set up a triumvirate ai (see tripAI.dm)
var/triai = FALSE
var/tipped = 0 //Did we broadcast the tip of the day yet?
var/tipped = FALSE //Did we broadcast the tip of the day yet?
var/selected_tip // What will be the tip of the day?
var/timeLeft //pregame timer
@@ -227,7 +227,7 @@ SUBSYSTEM_DEF(ticker)
if(!mode)
if(!runnable_modes.len)
to_chat(world, "<B>Unable to choose playable game mode.</B> Reverting to pre-game lobby.")
return 0
return FALSE
mode = pickweight(runnable_modes)
if(!mode) //too few roundtypes all run too recently
mode = pick(runnable_modes)
@@ -239,7 +239,7 @@ SUBSYSTEM_DEF(ticker)
qdel(mode)
mode = null
SSjob.ResetOccupations()
return 0
return FALSE
CHECK_TICK
//Configure mode and assign player to special mode stuff
@@ -255,7 +255,7 @@ SUBSYSTEM_DEF(ticker)
QDEL_NULL(mode)
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
SSjob.ResetOccupations()
return 0
return FALSE
else
message_admins("<span class='notice'>DEBUG: Bypassing prestart checks...</span>")