mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Add job_globals sanitization, fix duplicate value (#24795)
* Add job_globals sanitization, fix duplicate value * Remove 'support_positions' job category * Add Supply dept to jobban list
This commit is contained in:
@@ -160,10 +160,10 @@
|
||||
"rounds" = (rounds ? "[rounds]" : "0"), // And here
|
||||
"ckey" = ckey,
|
||||
"computerid" = computerid,
|
||||
"ip" = ip,
|
||||
"ip" = "[ip ? ip : ""]", // This is important. NULL is not the same as "", and if you directly open the `.dmb` file, you get a NULL IP.
|
||||
"a_ckey" = a_ckey,
|
||||
"a_computerid" = a_computerid,
|
||||
"a_ip" = a_ip,
|
||||
"a_ip" = "[a_ip ? a_ip : ""]",
|
||||
"who" = who,
|
||||
"adminwho" = adminwho,
|
||||
"roundid" = GLOB.round_id,
|
||||
@@ -490,7 +490,7 @@
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in GLOB.other_roles)
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
|
||||
for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","servicedept","nonhumandept"))
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
for(var/j in list("Syndicate") + GLOB.antag_roles)
|
||||
output += "<option value='[j]'>[j]</option>"
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
message_admins("Ban process: A mob matching [playermob.ckey] was found at location [playermob.x], [playermob.y], [playermob.z]. Custom IP and computer id fields replaced with the IP and computer id from the located mob")
|
||||
|
||||
if(job_ban)
|
||||
if(banjob in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept"))
|
||||
if(banjob in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","servicedept","supplydept","nonhumandept"))
|
||||
multi_job = TRUE
|
||||
switch(banjob)
|
||||
if("commanddept")
|
||||
@@ -194,8 +194,14 @@
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
jobs_to_ban += temp.title
|
||||
if("supportdept")
|
||||
for(var/jobPos in GLOB.support_positions)
|
||||
if("servicedept")
|
||||
for(var/jobPos in GLOB.service_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
jobs_to_ban += temp.title
|
||||
if("supplydept")
|
||||
for(var/jobPos in GLOB.supply_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
@@ -553,11 +559,32 @@
|
||||
counter = 0
|
||||
jobs += "</tr></table>"
|
||||
|
||||
//Support (Grey)
|
||||
//Service (Grey)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.support_positions)]'><a href='?src=[UID()];jobban3=supportdept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Support Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.support_positions)
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(GLOB.service_positions)]'><a href='?src=[UID()];jobban3=servicedept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Service Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.service_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[job.title];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'><font color=red>[replacetext(job.title, " ", " ")]</font></a></td>"
|
||||
counter++
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=[UID()];jobban3=[job.title];jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>[replacetext(job.title, " ", " ")]</a></td>"
|
||||
counter++
|
||||
|
||||
if(counter >= 5) //So things dont get squiiiiished!
|
||||
jobs += "</tr><tr align='center'>"
|
||||
counter = 0
|
||||
jobs += "</tr></table>"
|
||||
|
||||
//Supply (Brown)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='e2c59d'><th colspan='[length(GLOB.supply_positions)]'><a href='?src=[UID()];jobban3=supplydept;jobban4=[M.UID()];dbbanaddckey=[M.ckey]'>Supply Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in GLOB.supply_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
@@ -668,7 +695,7 @@
|
||||
to_chat(usr, "<span class='warning'>SSjobs has not been setup!</span>")
|
||||
return
|
||||
|
||||
//get jobs for department if specified, otherwise just returnt he one job in a list.
|
||||
//get jobs for department if specified, otherwise just return the one job in a list.
|
||||
var/list/joblist = list()
|
||||
switch(href_list["jobban3"])
|
||||
if("commanddept")
|
||||
@@ -701,8 +728,14 @@
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("supportdept")
|
||||
for(var/jobPos in GLOB.support_positions)
|
||||
if("servicedept")
|
||||
for(var/jobPos in GLOB.service_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("supplydept")
|
||||
for(var/jobPos in GLOB.supply_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
|
||||
Reference in New Issue
Block a user