diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index 155f7dfae58..883856cc9b7 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -209,7 +209,7 @@
var/turf/ear = get_turf(M)
if(ear)
// Ghostship is magic: Ghosts can hear radio chatter from anywhere
- if(speaker_coverage[ear] || (istype(M, /mob/dead/observer) && (M.client) && (M.client.prefs.toggles & CHAT_GHOSTRADIO)))
+ if(speaker_coverage[ear] || (istype(M, /mob/dead/observer) && M.get_preference(CHAT_GHOSTRADIO)))
. |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down.
return .
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index bc682a4f168..b51a6074ec9 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -407,7 +407,7 @@ var/round_start_time = 0
if(player.client)
if(player.client.karma_spent == 0)
- if(player.client.prefs && !(player.client.prefs.toggles & DISABLE_KARMA_REMINDER))
+ if(player.get_preference(DISABLE_KARMA_REMINDER))
var/dat
dat += {"
Karma ReminderKarma Reminder
You have not yet spent your karma for the round, surely there is a player who was worthy of receiving
diff --git a/code/game/gamemodes/scoreboard.dm b/code/game/gamemodes/scoreboard.dm
index c4957b3b937..bd391550b62 100644
--- a/code/game/gamemodes/scoreboard.dm
+++ b/code/game/gamemodes/scoreboard.dm
@@ -150,9 +150,8 @@
to_chat(world, "The crew's final score is:")
to_chat(world, "[score_crewscore]")
for(var/mob/E in player_list)
- if(E.client)
- if(E.client.prefs && !(E.client.prefs.toggles & DISABLE_SCOREBOARD))
- E.scorestats()
+ if(E.client && !E.get_preference(DISABLE_SCOREBOARD))
+ E.scorestats()
// A recursive function to properly determine the wealthiest escapee
/datum/controller/gameticker/proc/get_score_container_worth(atom/C, level=0)
diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm
index 520b1182e49..23d217a83bc 100644
--- a/code/game/jobs/job_exp.dm
+++ b/code/game/jobs/job_exp.dm
@@ -7,7 +7,7 @@
return
var/msg = "Playtime ReportPlaytime:
"
src << browse(msg, "window=Player_playtime_check")
@@ -78,29 +78,30 @@
return_text += "Exempt (all jobs auto-unlocked)"
else if(exp_data[EXP_TYPE_LIVING] > 0)
var/my_pc = num2text(round(exp_data[dep]/exp_data[EXP_TYPE_LIVING]*100))
- return_text += "[dep] [get_exp_format(exp_data[dep])] ([my_pc]%)"
+ return_text += "[dep]: [get_exp_format(exp_data[dep])] ([my_pc]%)"
else
- return_text += "[dep] [get_exp_format(exp_data[dep])] "
+ return_text += "[dep]: [get_exp_format(exp_data[dep])] "
if(config.use_exp_restrictions_admin_bypass && check_rights(R_ADMIN, 0, mob))
- return_text += "Admin (all jobs auto-unlocked)"
+ return_text += "Admin"
return_text += ""
- var/list/jobs_locked = list()
- var/list/jobs_unlocked = list()
- for(var/datum/job/job in job_master.occupations)
- if(job.exp_requirements && job.exp_type)
- if(!job.available_in_playtime(mob.client))
- jobs_unlocked += job.title
- else
- var/xp_req = job.get_exp_req_amount()
- jobs_locked += "[job.title] [get_exp_format(text2num(play_records[job.get_exp_req_type()]))] / [get_exp_format(xp_req)] as [job.get_exp_req_type()])"
- if(jobs_unlocked.len)
- return_text += "
Jobs Unlocked:- "
- return_text += jobs_unlocked.Join("
- ")
- return_text += "
"
- if(jobs_locked.len)
- return_text += "
Jobs Not Unlocked:- "
- return_text += jobs_locked.Join("
- ")
- return_text += "
"
+ if(config.use_exp_restrictions)
+ var/list/jobs_locked = list()
+ var/list/jobs_unlocked = list()
+ for(var/datum/job/job in job_master.occupations)
+ if(job.exp_requirements && job.exp_type)
+ if(!job.available_in_playtime(mob.client))
+ jobs_unlocked += job.title
+ else
+ var/xp_req = job.get_exp_req_amount()
+ jobs_locked += "[job.title] ([get_exp_format(text2num(play_records[job.get_exp_req_type()]))] / [get_exp_format(xp_req)] as [job.get_exp_req_type()])"
+ if(jobs_unlocked.len)
+ return_text += "
Jobs Unlocked:- "
+ return_text += jobs_unlocked.Join("
- ")
+ return_text += "
"
+ if(jobs_locked.len)
+ return_text += "
Jobs Not Unlocked:- "
+ return_text += jobs_locked.Join("
- ")
+ return_text += "
"
return return_text
@@ -115,7 +116,7 @@
else if(expnum > 0)
return num2text(expnum) + "m"
else
- return "0h"
+ return "none"
/proc/update_exp(var/mins, var/ann = 0)
if(!establish_db_connection())
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index 44a3181b8b9..7449f731f11 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -285,14 +285,14 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Loop through the receivers and categorize them --- */
- if(R.client && R.client.holder && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
+ if(is_admin(R) && !R.get_preference(CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
continue
if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes.
continue
// Ghosts hearing all radio chat don't want to hear syndicate intercepts, they're duplicates
- if(data == 3 && istype(R, /mob/dead/observer) && R.client && (R.client.prefs.toggles & CHAT_GHOSTRADIO))
+ if(data == 3 && istype(R, /mob/dead/observer) && R.get_preference(CHAT_GHOSTRADIO))
continue
// --- Check for compression ---
@@ -495,7 +495,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Loop through the receivers and categorize them --- */
- if(R.client && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
+ if(R.client && !R.get_preference(CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
continue
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
index 13fea30a7f8..84577b51102 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
@@ -78,22 +78,23 @@
if("where" in query_tree)
var/objs_temp = objs
objs = list()
- for(var/datum/d in objs_temp)
+ for(var/d in objs_temp)
if(SDQL_expression(d, query_tree["where"]))
objs += d
switch(query_tree[1])
if("call")
- for(var/datum/d in objs)
+ for(var/d in objs)
SDQL_var(d, query_tree["call"][1], source = d)
if("delete")
- for(var/datum/d in objs)
+ for(var/d in objs)
qdel(d)
if("select")
var/text = ""
- for(var/datum/t in objs)
+ for(var/o in objs)
+ var/datum/t = o
text += "\ref[t]"
if(istype(t, /atom))
var/atom/a = t
@@ -115,7 +116,7 @@
if("update")
if("set" in query_tree)
var/list/set_list = query_tree["set"]
- for(var/datum/d in objs)
+ for(var/d in objs)
for(var/list/sets in set_list)
var/datum/temp = d
var/i = 0
@@ -252,6 +253,12 @@
if(istype(d, type))
out += d
+ else if(ispath(type, /client))
+ for(var/client/C)
+ if((location != world) && !(C.mob in location))
+ continue
+ out += C
+
else if(location == world)
for(var/datum/d)
if(istype(d, type))
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index 8f82ab7274f..bf139ee4c8b 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -596,7 +596,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
continue
var/available_in_playtime = job.available_in_playtime(user.client)
if(available_in_playtime)
- HTML += "[rank] \[ " + get_exp_format(available_in_playtime) + " as " + job.get_exp_req_type() + " | "
+ HTML += "[rank] \[ " + get_exp_format(available_in_playtime) + " as " + job.get_exp_req_type() + " \] | "
continue
if(!job.player_old_enough(user.client))
var/available_in_days = job.available_in_days(user.client)
diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm
index ecdc6a0220a..be6fa4a6c39 100644
--- a/code/modules/mob/emote.dm
+++ b/code/modules/mob/emote.dm
@@ -48,7 +48,7 @@
continue
if(findtext(message," snores.")) //Because we have so many sleeping people.
break
- if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
+ if(M.stat == DEAD && M.get_preference(CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
@@ -118,8 +118,8 @@
if(istype(M, /mob/new_player))
continue
- if(check_rights(R_ADMIN|R_MOD, 0, M) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to admins/mods
+ if(check_rights(R_ADMIN|R_MOD, 0, M) && M.get_preference(CHAT_DEAD)) // Show the emote to admins/mods
to_chat(M, message)
- else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on
+ else if(M.stat == DEAD && M.get_preference(CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on
M.show_message(message, 2)
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 37826ae0a10..558a6f8e9de 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -868,7 +868,7 @@
for(var/mob/M in dead_mob_list)
if(!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers and new players
- if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
+ if(M.stat == DEAD && M.get_preference(CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
switch(m_type)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index 320c44c2a68..d5a1580ded9 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -244,7 +244,7 @@ proc/get_radio_key_from_channel(var/channel)
continue //skip monkeys and leavers
if(isnewplayer(M))
continue
- if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS) && client) // client is so that ghosts don't have to listen to mice
+ if(M.stat == DEAD && M.client && M.get_preference(CHAT_GHOSTEARS) && client) // client is so that ghosts don't have to listen to mice
listening |= M
continue
if(get_turf(M) in hearturfs)
@@ -288,8 +288,8 @@ proc/get_radio_key_from_channel(var/channel)
if(client.prefs.muted & MUTE_IC)
to_chat(src, "You cannot speak in IC (Muted).")
return
-
- if(stat)
+
+ if(stat)
return 0
if(..(act, type, message))
@@ -302,7 +302,7 @@ proc/get_radio_key_from_channel(var/channel)
if(!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers and new players //who the hell knows why new players are in the dead mob list
- if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
+ if(M.stat == DEAD && M.get_preference(CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
switch(type)
@@ -402,7 +402,7 @@ proc/get_radio_key_from_channel(var/channel)
for(var/mob/M in dead_mob_list) //does this include players who joined as observers as well?
if(!M.client)
continue
- if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS))
+ if(M.stat == DEAD && M.client && M.get_preference(CHAT_GHOSTEARS))
listening |= M
//Pass whispers on to anything inside the immediate listeners.
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 5fcc3402773..0b04647d094 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -411,7 +411,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
name = realname
for(var/mob/M in player_list)
- if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || check_rights(R_ADMIN|R_MOD,0,M)) && (M.client.prefs.toggles & CHAT_DEAD))
+ if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || check_rights(R_ADMIN|R_MOD,0,M)) && M.get_preference(CHAT_DEAD))
var/follow
var/lname
if(subject)
@@ -586,4 +586,13 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
if(5)
newletter="glor"
newphrase+="[newletter]";counter-=1
- return newphrase
\ No newline at end of file
+ return newphrase
+
+/mob/proc/get_preference(toggleflag)
+ if(!client)
+ return FALSE
+ if(!client.prefs)
+ log_runtime(EXCEPTION("Mob '[src]', ckey '[ckey]' is missing a prefs datum on the client!"))
+ return FALSE
+ // Cast to 1/0
+ return !!(client.prefs.toggles & toggleflag)
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 4cae827dd8e..c24dec2413f 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -514,7 +514,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s
if(on==0)
src.icon_state = icon_off
camera.c_tag = null
- camera.network = null
+ camera.network = list()
else
src.icon_state = icon_on
camera.network = list("news")
diff --git a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm
index 69b9d449f2c..031e23c260d 100644
--- a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm
+++ b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm
@@ -117,7 +117,7 @@
continue //skip monkeys and leavers
if(istype(M, /mob/new_player))
continue
- if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
+ if(M.stat == DEAD && M.get_preference(CHAT_GHOSTEARS))
listening|=M
for(var/mob/M in listening)
diff --git a/html/changelogs/AutoChangeLog-pr-6064.yml b/html/changelogs/AutoChangeLog-pr-6064.yml
new file mode 100644
index 00000000000..bd8b2386e35
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-6064.yml
@@ -0,0 +1,4 @@
+author: "Krausus"
+delete-after: True
+changes:
+ - bugfix: "SDQL2 can now directly manipulate clients."
diff --git a/html/changelogs/AutoChangeLog-pr-6065.yml b/html/changelogs/AutoChangeLog-pr-6065.yml
new file mode 100644
index 00000000000..d4f9dfcfd61
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-6065.yml
@@ -0,0 +1,4 @@
+author: "Crazylemon64"
+delete-after: True
+changes:
+ - bugfix: "You should no longer go mute randomly"