Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MosleyTheMalO committed Dec 5, 2024
2 parents 836b41f + 51b854d commit dedc5ae
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 22 deletions.
17 changes: 6 additions & 11 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,14 @@
var/static/list/show_directions = list(SOUTH, WEST)
if(H.mind && (H.mind.assigned_role != H.mind.special_role) && (H.mind.assigned_role != "Stowaway"))
var/assignment
var/displayed_rank
if(H.mind.assigned_role)
assignment = H.mind.assigned_role
else if(H.job)
assignment = H.job
else
assignment = "Unassigned"
if(C && C.prefs && C.prefs.alt_titles_preferences[assignment])
assignment = C.prefs.alt_titles_preferences[assignment]

if(assignment)
displayed_rank = C.prefs.alt_titles_preferences[assignment]
if(C && C.prefs && C.prefs.alt_titles_preferences[assignment])
assignment = C.prefs.alt_titles_preferences[assignment]

var/static/record_id_num = 1001
var/id = num2hex(record_id_num++,6)
Expand All @@ -176,10 +172,8 @@
var/datum/data/record/G = new()
G.fields["id"] = id
G.fields["name"] = H.real_name
if(!displayed_rank)
G.fields["rank"] = assignment
else
G.fields["rank"] = "[displayed_rank], [assignment]"
G.fields["rank"] = assignment
G.fields["real_rank"] = GetJobName(assignment)
G.fields["age"] = H.age
G.fields["species"] = H.dna.species.name
G.fields["fingerprint"] = md5(H.dna.uni_identity)
Expand Down Expand Up @@ -226,7 +220,8 @@
var/datum/data/record/L = new()
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others?
L.fields["name"] = H.real_name
L.fields["rank"] = displayed_rank
L.fields["rank"] = assignment
L.fields["real_rank"] = GetJobName(assignment)
L.fields["age"] = H.age
if(H.gender == MALE)
G.fields["gender"] = "Male"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/world_topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
var/require_comms_key = FALSE

/datum/world_topic/proc/TryRun(list/input, addr)
key_valid = config && (CONFIG_GET(string/comms_key) == input["key"])
key_valid = (CONFIG_GET(string/comms_key) == input["key"]) && CONFIG_GET(string/comms_key) && input["key"]
if(require_comms_key && !key_valid)
return "Bad Key"
input -= "key"
Expand Down
38 changes: 32 additions & 6 deletions code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@
<tr><td>Gender:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=gender'>&nbsp;[active1.fields["gender"]]&nbsp;</A></td></tr>
<tr><td>Age:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=age'>&nbsp;[active1.fields["age"]]&nbsp;</A></td></tr>"}
dat += "<tr><td>Species:</td><td><A href ='?src=[REF(src)];choice=Edit Field;field=species'>&nbsp;[active1.fields["species"]]&nbsp;</A></td></tr>"
dat += {"<tr><td>Rank:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=rank'>&nbsp;[active1.fields["rank"]]&nbsp;</A></td></tr>
var/record_rank = GetJobName(active1.fields["rank"])
var/datum/job/job_datum = SSjob.name_occupations[record_rank]
var/how_many_alts = job_datum ? length(job_datum.alt_titles) : null
dat += {"<tr><td>Rank:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=rank'>&nbsp;[active1.fields["rank"]]&nbsp;</A>
<br />
<a href='?src=[REF(src)];choice=Edit Field;field=alt_title;rank=[record_rank]'>Change title<span style='color:#BBBBBB; font-style: italic;'> ([how_many_alts + 1] options)</span></a></td></tr>
<tr><td>Fingerprint:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=fingerprint'>&nbsp;[active1.fields["fingerprint"]]&nbsp;</A></td></tr>
<tr><td>Physical Status:</td><td>&nbsp;[active1.fields["p_stat"]]&nbsp;</td></tr>
<tr><td>Mental Status:</td><td>&nbsp;[active1.fields["m_stat"]]&nbsp;</td></tr>
Expand Down Expand Up @@ -692,23 +697,44 @@ What a mess.*/
temp += "<li><a href='?src=[REF(src)];choice=Change Criminal Status;criminal2=released'>Discharged</a></li>"
temp += "</ul>"
if("rank")
if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access)))
if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access) || (ACCESS_CENT_GENERAL in logged_access)))
temp = "<h5>Rank:</h5>"
temp += "<ul>"
for(var/rank in get_all_jobs())
temp += "<li><a href='?src=[REF(src)];choice=Change Rank;rank=[rank]'>[rank]</a></li>"
temp += "<li><a href='?src=[REF(src)];choice=Change Rank;rank=[rank]'>[rank]</a>"
var/datum/job/job_datum = SSjob.name_occupations[rank]
if(job_datum && length(job_datum.alt_titles))
var/how_many_alts = length(job_datum.alt_titles)
temp += "<a href='?src=[REF(src)];choice=Edit Field;field=alt_title;rank=[rank]'>Use Title<span style='color:#BBBBBB; font-style: italic;'> ([how_many_alts + 1] options)</span></a>"
temp += "</li>"
temp += "</ul>"
else
alert(usr, "You do not have the required rank to do this!")
if("alt_title")
if(istype(active1, /datum/data/record) && ((ACCESS_CAPTAIN in logged_access) || (ACCESS_HOP in logged_access) || (ACCESS_CENT_GENERAL in logged_access)))
temp = "<h5>Rank Title:</h5>"
temp += "<ul>"
var/chosen_rank = href_list["rank"]
temp += "<li><a href='?src=[REF(src)];choice=Change Rank;rank=[chosen_rank]'>[chosen_rank]</a></li><br />"
var/datum/job/job_datum = SSjob.name_occupations[chosen_rank]
if(job_datum && length(job_datum.alt_titles))
for(var/rank in job_datum.alt_titles)
temp += "<li><a href='?src=[REF(src)];choice=Change Rank;rank=[rank]'>[rank]</a></li>"
else
temp += "<li><b>We're very sorry, there was an internal error fetching titles. Report to centcom error: </b>null_job_or_no_titles</li>"
temp += "</ul>"
else
alert(usr, "You do not have the required rank to do this!")

//TEMPORARY MENU FUNCTIONS
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
if("Change Rank")
if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in get_all_jobs())
active1.fields["real_rank"] = href_list["real_rank"]
if(GetJobName(href_list["rank"]) != "Unknown" && GetJobName(href_list["rank"]) != "Centcom") // hi hello you looking, stop trying to exploit html
active1.fields["rank"] = href_list["rank"]
active1.fields["real_rank"] = GetJobName(href_list["rank"])

if("Change Criminal Status")
if(active2)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@
log_admin("[key_name(usr)] stuffed [frommob.key] into [tomob.name].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Ghost Drag Control")

tomob.ckey = frommob.ckey
tomob.key = frommob.key
qdel(frommob)

return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/dead/observer/respawn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@
client.view_size.resetToDefault()

var/mob/dead/new_player/M = new /mob/dead/new_player
M.ckey = ckey
M.key = key
return M
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@
if(GLOB.announcement_systems.len)
// Sends an announcement the AI has cryoed.
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
announcer.announce("CRYOSTORAGE", src.real_name, announce_rank, announce_rank, list())
announcer.announce("CRYOSTORAGE", real_name, announce_rank, announce_rank, list())
new /obj/structure/ai_core/latejoin_inactive(loc)
if(src.mind)
//Handle job slot/tater cleanup.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
client.prefs.chat_toggles ^= CHAT_OOC
if (!(client.prefs.chat_toggles & CHAT_OOC) && isdead(new_mob))
client.prefs.chat_toggles ^= CHAT_OOC
new_mob.ckey = ckey
new_mob.key = key
if(send_signal)
SEND_SIGNAL(src, COMSIG_MOB_KEY_CHANGE, new_mob, src)
//splurt changeh
Expand Down
7 changes: 7 additions & 0 deletions html/changelogs/archive/2024-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@
- bugfix: Misc things, like removing the bombs
- rscadd: Medical patient rooms, for "fun"
- rscadd: A work-around fix for medical having issues monitoring crew
2024-12-04:
SandPoot:
- rscadd: Higher staff can now set titles for you on the manifest using the security
console.
- bugfix: Manifest will no longer have people with null jobs.
- bugfix: High security vulnerability, you can no longer set your rank to be anything
(see pr for info).

0 comments on commit dedc5ae

Please sign in to comment.