Bools and returns super-pr (#53221)

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>
This commit is contained in:
TiviPlus
2020-08-28 23:26:37 +02:00
committed by GitHub
parent cb49d3301b
commit ca366c3ea1
355 changed files with 1549 additions and 1591 deletions
+1 -1
View File
@@ -487,7 +487,7 @@ GLOBAL_PROTECT(admin_verbs_hideable)
switch(choice)
if(null)
return 0
return
if("Small Bomb (1, 2, 3, 3)")
explosion(epicenter, 1, 2, 3, 3, TRUE, TRUE)
if("Medium Bomb (2, 3, 4, 4)")
+1 -1
View File
@@ -130,7 +130,7 @@ GLOBAL_PROTECT(LastAdminCalledProc)
/client/proc/callproc_datum(datum/A as null|area|mob|obj|turf)
set category = "Debug"
set name = "Atom ProcCall"
set waitfor = 0
set waitfor = FALSE
if(!check_rights(R_DEBUG))
return
+12 -12
View File
@@ -130,21 +130,21 @@ GLOBAL_PROTECT(href_token)
/datum/admins/proc/check_for_rights(rights_required)
if(rights_required && !(rights_required & rank.rights))
return 0
return 1
return FALSE
return TRUE
/datum/admins/proc/check_if_greater_rights_than_holder(datum/admins/other)
if(!other)
return 1 //they have no rights
return TRUE //they have no rights
if(rank.rights == R_EVERYTHING)
return 1 //we have all the rights
return TRUE //we have all the rights
if(src == other)
return 1 //you always have more rights than yourself
return TRUE //you always have more rights than yourself
if(rank.rights != other.rank.rights)
if( (rank.rights & other.rank.rights) == other.rank.rights )
return 1 //we have all the rights they have and more
return 0
return TRUE //we have all the rights they have and more
return FALSE
/datum/admins/vv_edit_var(var_name, var_value)
return FALSE //nice try trialmin
@@ -166,26 +166,26 @@ you will have to do something like if(client.rights & R_ADMIN) yourself.
/proc/check_rights(rights_required, show_msg=1)
if(usr && usr.client)
if (check_rights_for(usr.client, rights_required))
return 1
return TRUE
else
if(show_msg)
to_chat(usr, "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>", confidential = TRUE)
return 0
return FALSE
//probably a bit iffy - will hopefully figure out a better solution
/proc/check_if_greater_rights_than(client/other)
if(usr && usr.client)
if(usr.client.holder)
if(!other || !other.holder)
return 1
return TRUE
return usr.client.holder.check_if_greater_rights_than_holder(other.holder)
return 0
return FALSE
//This proc checks whether subject has at least ONE of the rights specified in rights_required.
/proc/check_rights_for(client/subject, rights_required)
if(subject && subject.holder)
return subject.holder.check_for_rights(rights_required)
return 0
return FALSE
/proc/GenerateToken()
. = ""
+3 -3
View File
@@ -95,7 +95,7 @@
/datum/admins/proc/Secrets_topic(item,href_list)
var/datum/round_event/E
var/ok = 0
var/ok = FALSE
switch(item)
if("admin_log")
var/dat = "<B>Admin Log<HR></B>"
@@ -290,7 +290,7 @@
for(var/i in GLOB.human_list)
var/mob/living/carbon/human/H = i
INVOKE_ASYNC(H, /mob/living/carbon.proc/monkeyize)
ok = 1
ok = TRUE
if("allspecies")
if(!check_rights(R_FUN))
@@ -709,7 +709,7 @@
to_chat(world, text("<B>A secret has been activated by []!</B>", usr.key), confidential = TRUE)
/proc/portalAnnounce(announcement, playlightning)
set waitfor = 0
set waitfor = FALSE
if (playlightning)
sound_to_playing_players('sound/magic/lightning_chargeup.ogg')
sleep(80)
+1 -1
View File
@@ -562,7 +562,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
. = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list())
for(var/client/X in GLOB.admins)
.["total"] += X
if(requiredflags != 0 && !check_rights_for(X, requiredflags))
if(requiredflags != NONE && !check_rights_for(X, requiredflags))
.["noflags"] += X
else if(X.is_afk())
.["afk"] += X
+5 -5
View File
@@ -98,11 +98,11 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
available.Add(C)
var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in sortNames(available)
if(!choice)
return 0
return
if(!isobserver(choice))
var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No")
if(confirm != "Yes")
return 0
return
var/obj/item/paicard/card = new(T)
var/mob/living/silicon/pai/pai = new(card)
@@ -590,12 +590,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/obj/machinery/power/emitter/E in GLOB.machines)
if(E.anchored)
E.active = 1
E.active = TRUE
for(var/obj/machinery/field/generator/F in GLOB.machines)
if(F.active == 0)
if(F.active == FALSE)
F.set_anchored(TRUE)
F.active = 1
F.active = TRUE
F.state = 2
F.power = 250
F.warming_up = 3
+2 -2
View File
@@ -66,7 +66,7 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping)
icon_state = "yellow"
/obj/effect/debugging/marker/Move()
return 0
return FALSE
/client/proc/camera_view()
set category = "Mapping"
@@ -111,7 +111,7 @@ GLOBAL_LIST_EMPTY(dirty_vars)
if(!Master)
alert(usr,"Master_controller not found.","Sec Camera Report")
return 0
return FALSE
var/list/obj/machinery/camera/CL = list()
+11 -11
View File
@@ -69,10 +69,10 @@
H.mind.make_Traitor()
candidates.Remove(H)
return 1
return TRUE
return 0
return FALSE
/datum/admins/proc/makeChangelings()
@@ -101,9 +101,9 @@
H.mind.make_Changeling()
candidates.Remove(H)
return 1
return TRUE
return 0
return FALSE
/datum/admins/proc/makeRevs()
@@ -130,9 +130,9 @@
H = pick(candidates)
H.mind.make_Rev()
candidates.Remove(H)
return 1
return TRUE
return 0
return FALSE
/datum/admins/proc/makeWizard()
@@ -170,9 +170,9 @@
H.mind.make_Cultist()
candidates.Remove(H)
return 1
return TRUE
return 0
return FALSE
@@ -200,7 +200,7 @@
break
//Making sure we have atleast 3 Nuke agents, because less than that is kinda bad
if(agentcount < 3)
return 0
return FALSE
//Let's find the spawn locations
var/leader_chosen = FALSE
@@ -213,9 +213,9 @@
nuke_team = N.nuke_team
else
new_character.mind.add_antag_datum(/datum/antagonist/nukeop,nuke_team)
return 1
return TRUE
else
return 0
return FALSE
+1 -1
View File
@@ -16,7 +16,7 @@
admin_sound.channel = CHANNEL_ADMIN
admin_sound.frequency = freq
admin_sound.wait = 1
admin_sound.repeat = 0
admin_sound.repeat = FALSE
admin_sound.status = SOUND_STREAM
admin_sound.volume = vol
+4 -4
View File
@@ -300,7 +300,7 @@
else
to_chat(usr, "<span class='danger'>Error: create_xeno(): no suitable candidates.</span>", confidential = TRUE)
if(!istext(ckey))
return 0
return FALSE
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva")
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : null
@@ -319,7 +319,7 @@
if("Larva")
new_xeno = new /mob/living/carbon/alien/larva(spawn_here)
else
return 0
return FALSE
if(!spawn_here)
SSjob.SendToLateJoin(new_xeno, FALSE)
@@ -327,7 +327,7 @@
var/msg = "<span class='notice'>[key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].</span>"
message_admins(msg)
admin_ticket_log(new_xeno, msg)
return 1
return TRUE
/*
If a guy was gibbed and you want to revive him, this is a good way to do so.
@@ -831,7 +831,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in GLOB.nuke_list)
set name = "Toggle Nuke"
set category = "Admin - Events"
set popup_menu = 0
set popup_menu = FALSE
if(!check_rights(R_DEBUG))
return