From e73866cbf50598ef15642997ca2c5efe59f3e8c2 Mon Sep 17 00:00:00 2001
From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Date: Tue, 7 Sep 2021 12:52:28 +0100
Subject: [PATCH] Review tweaks
---
code/__HELPERS/global_lists.dm | 2 +-
code/game/jobs/job/job.dm | 2 +-
code/modules/admin/verbs/one_click_antag.dm | 2 +-
code/modules/admin/verbs/striketeam.dm | 2 +-
.../admin/verbs/striketeam_syndicate.dm | 2 +-
code/modules/admin/watchlist.dm | 1 +
code/modules/client/client_procs.dm | 11 ++---
.../client/login_processing/36-watchlist.dm | 4 +-
.../client/login_processing/37-alts_ip.dm | 2 +-
.../client/login_processing/38-alts_cid.dm | 2 +-
code/modules/client/preference/character.dm | 47 +++++++++----------
.../client/preference/link_processing.dm | 7 +--
code/modules/client/preference/preferences.dm | 4 +-
.../client/preference/preferences_mysql.dm | 3 +-
14 files changed, 45 insertions(+), 46 deletions(-)
diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm
index 058aecc2819..ea29bdd3d39 100644
--- a/code/__HELPERS/global_lists.dm
+++ b/code/__HELPERS/global_lists.dm
@@ -131,7 +131,7 @@
// Setup client login processors.
for(var/processor_type in subtypesof(/datum/client_login_processor))
var/datum/client_login_processor/CLP = new processor_type()
- GLOB.client_login_processors.Add(CLP)
+ GLOB.client_login_processors += CLP
// Sort them by priority, lowest first
sortTim(GLOB.client_login_processors, /proc/cmp_login_processor_priority)
diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm
index 881ba5893ec..7922cb721f7 100644
--- a/code/game/jobs/job/job.dm
+++ b/code/game/jobs/job/job.dm
@@ -173,7 +173,7 @@
if(box && H.dna.species.speciesbox)
box = H.dna.species.speciesbox
- if(allow_loadout && H.client && (H.client.prefs.active_character.loadout_gear && length(H.client.prefs.active_character.loadout_gear)))
+ if(allow_loadout && H.client && length(H.client.prefs.active_character.loadout_gear))
for(var/gear in H.client.prefs.active_character.loadout_gear)
var/datum/gear/G = GLOB.gear_datums[gear]
if(G)
diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm
index 57512a35863..f6e07210a05 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -392,7 +392,7 @@
S.randomise()
if(syndicate_leader_selected)
S.real_name = "[syndicate_commando_leader_rank] [syndicate_commando_name]"
- S.age = rand(35,45)
+ S.age = rand(35, 45)
else
S.real_name = "[syndicate_commando_rank] [syndicate_commando_name]"
S.copy_to(new_syndicate_commando)
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index b445314fbf1..9461ee24b72 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -141,7 +141,7 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
var/datum/character_save/S = new()//Randomize appearance for the commando.
S.randomise()
if(is_leader)
- S.age = rand(35,45)
+ S.age = rand(35, 45)
S.real_name = "[commando_leader_rank] [commando_name]"
else
S.real_name = "[commando_name]"
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index 37d5214ef34..69a32c21494 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -107,7 +107,7 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
var/datum/character_save/S = new()//Randomize appearance for the commando.
S.randomise()
if(is_leader)
- S.age = rand(35,45)
+ S.age = rand(35, 45)
S.real_name = "[syndicate_commando_leader_rank] [syndicate_commando_name]"
else
S.real_name = "[syndicate_commando_rank] [syndicate_commando_name]"
diff --git a/code/modules/admin/watchlist.dm b/code/modules/admin/watchlist.dm
index b6a7c14280c..6b98a6050cf 100644
--- a/code/modules/admin/watchlist.dm
+++ b/code/modules/admin/watchlist.dm
@@ -16,6 +16,7 @@
qdel(query_watchfind)
return
else
+ qdel(query_watchfind)
target_ckey = new_ckey
var/already_watched = FALSE
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 37237e175ce..2b89fd249c4 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -286,18 +286,18 @@
log_client_to_db(tdata) // Make sure our client exists in the DB
- // This is where stuff happens on the client
+ // This is where we load all of the clients stuff from the DB
if(SSdbcore.IsConnected())
// Load in all our client data from the DB
var/list/datum/db_query/login_queries = list() // List of queries to run for login processing
- for(var/datum/client_login_processor/CLP in GLOB.client_login_processors)
+ for(var/datum/client_login_processor/CLP as anything in GLOB.client_login_processors)
login_queries[CLP.type] = CLP.get_query(src)
SSdbcore.MassExecute(login_queries, TRUE, FALSE, TRUE, FALSE) // Warn, no qdel, assoc, no log
// Now do fancy things with the results
- for(var/datum/client_login_processor/CLP in GLOB.client_login_processors)
+ for(var/datum/client_login_processor/CLP as anything in GLOB.client_login_processors)
CLP.process_result(login_queries[CLP.type], src)
QDEL_LIST_ASSOC_VAL(login_queries) // Clear out the used queries
@@ -309,7 +309,7 @@
prefs.character_saves = list()
// Random character
- prefs.character_saves.Add(new /datum/character_save)
+ prefs.character_saves += new /datum/character_save
prefs.active_character = prefs.character_saves[1]
// ToS accepted
@@ -318,8 +318,7 @@
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
- if(world.byond_version >= 511 && byond_version >= 511 && prefs.clientfps)
- fps = prefs.clientfps
+ fps = prefs.clientfps
// Log alts
if(length(related_accounts_ip))
diff --git a/code/modules/client/login_processing/36-watchlist.dm b/code/modules/client/login_processing/36-watchlist.dm
index a469b5937fb..fa58d3b57f9 100644
--- a/code/modules/client/login_processing/36-watchlist.dm
+++ b/code/modules/client/login_processing/36-watchlist.dm
@@ -2,8 +2,8 @@
priority = 36
/datum/client_login_processor/watchlist/get_query(client/C)
- var/datum/db_query/query = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:target_ckey", list(
- "target_ckey" = C.ckey
+ var/datum/db_query/query = SSdbcore.NewQuery("SELECT reason FROM watch WHERE ckey=:ckey", list(
+ "ckey" = C.ckey
))
return query
diff --git a/code/modules/client/login_processing/37-alts_ip.dm b/code/modules/client/login_processing/37-alts_ip.dm
index edf47b0f458..f67255f3295 100644
--- a/code/modules/client/login_processing/37-alts_ip.dm
+++ b/code/modules/client/login_processing/37-alts_ip.dm
@@ -11,4 +11,4 @@
while(Q.NextRow())
if("[Q.item[1]]" == C.ckey)
continue
- C.related_accounts_ip.Add("[Q.item[1]]")
+ C.related_accounts_ip += "[Q.item[1]]"
diff --git a/code/modules/client/login_processing/38-alts_cid.dm b/code/modules/client/login_processing/38-alts_cid.dm
index 541204b529e..9613e9fcc3d 100644
--- a/code/modules/client/login_processing/38-alts_cid.dm
+++ b/code/modules/client/login_processing/38-alts_cid.dm
@@ -11,4 +11,4 @@
while(Q.NextRow())
if("[Q.item[1]]" == C.ckey)
continue
- C.related_accounts_cid.Add("[Q.item[1]]")
+ C.related_accounts_cid += "[Q.item[1]]"
diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm
index a1da7585f4f..32de91e9866 100644
--- a/code/modules/client/preference/character.dm
+++ b/code/modules/client/preference/character.dm
@@ -3,18 +3,18 @@
/datum/character_save
- var/real_name //our character's name
- var/be_random_name = 0 //whether we are a random name every round
- var/gender = MALE //gender of character (well duh)
- var/age = 30 //age of character
- var/spawnpoint = "Arrivals Shuttle" //where this character will spawn (0-2).
- var/b_type = "A+" //blood type (not-chooseable)
+ var/real_name //our character's name
+ var/be_random_name = FALSE //whether we are a random name every round
+ var/gender = MALE //gender of character (well duh)
+ var/age = 30 //age of character
+ var/spawnpoint = "Arrivals Shuttle" //where this character will spawn (0-2).
+ var/b_type = "A+" //blood type (not-chooseable)
var/underwear = "Nude" //underwear type
var/undershirt = "Nude" //undershirt type
- var/socks = "Nude" //socks type
- var/backbag = GBACKPACK //backpack type
- var/ha_style = "None" //Head accessory style
- var/hacc_colour = "#000000" //Head accessory colour
+ var/socks = "Nude" //socks type
+ var/backbag = GBACKPACK //backpack type
+ var/ha_style = "None" //Head accessory style
+ var/hacc_colour = "#000000" //Head accessory colour. If this line looks badly indented in vscode, its because of the shitty colour square
var/list/m_styles = list(
"head" = "None",
"body" = "None",
@@ -41,14 +41,14 @@
var/body_accessory = null
- var/speciesprefs = 0//I hate having to do this, I really do (Using this for oldvox code, making names universal I guess
+ var/speciesprefs = 0 //I hate having to do this, I really do (Using this for oldvox code, making names universal I guess
- //Mob preview
+ //Mob preview
var/icon/preview_icon = null
var/icon/preview_icon_front = null
var/icon/preview_icon_side = null
- //Jobs, uses bitflags
+ //Jobs, uses bitflags
var/job_support_high = 0
var/job_support_med = 0
var/job_support_low = 0
@@ -348,7 +348,7 @@
"med_record" = med_record,
"sec_record" = sec_record,
"gen_record" = gen_record,
- "playertitlelist" = (playertitlelist ? playertitlelist : ""), // This it intentnional. It wont work without it!
+ "playertitlelist" = (playertitlelist ? playertitlelist : ""), // This it intentional. It wont work without it!
"disabilities" = disabilities,
"organlist" = (organlist ? organlist : ""),
"rlimblist" = (rlimblist ? rlimblist : ""),
@@ -443,8 +443,8 @@
//Sanitize
var/datum/species/SP = GLOB.all_species[species]
- metadata = sanitize_text(metadata, initial(metadata))
- real_name = reject_bad_name(real_name, 1)
+ metadata = sanitize_text(metadata, initial(metadata))
+ real_name = reject_bad_name(real_name, TRUE)
if(isnull(species))
species = "Human"
@@ -459,7 +459,7 @@
speciesprefs = initial(speciesprefs)
if(!real_name)
- real_name = random_name(gender,species)
+ real_name = random_name(gender, species)
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender, FALSE, !SP.has_gender)
@@ -1771,7 +1771,7 @@
var/datum/species/S = GLOB.all_species[species]
character.set_species(S.type) // Yell at me if this causes everything to melt
if(be_random_name)
- real_name = random_name(gender,species)
+ real_name = random_name(gender, species)
character.add_language(language)
@@ -1850,7 +1850,7 @@
character.m_styles = m_styles
if(body_accessory)
- character.body_accessory = GLOB.body_accessory_by_name["[body_accessory]"]
+ character.body_accessory = GLOB.body_accessory_by_name[body_accessory]
character.backbag = backbag
@@ -1918,8 +1918,8 @@
character.dna.UpdateSE()
domutcheck(character, MUTCHK_FORCED) //'Activates' all the above disabilities.
- character.dna.ready_dna(character, flatten_SE = 0)
- character.sync_organ_dna(assimilate=1)
+ character.dna.ready_dna(character, flatten_SE = FALSE)
+ character.sync_organ_dna(assimilate = TRUE)
character.UpdateAppearance()
// Do the initial caching of the player's body icons.
@@ -1998,7 +1998,7 @@
continue
var/available_in_playtime = job.available_in_playtime(user.client)
if(available_in_playtime)
- html += "[rank]