Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the search function in Secmate to allow searching by criminal status. #18326

Merged
merged 8 commits into from
Mar 27, 2024
5 changes: 4 additions & 1 deletion code/modules/networks/computer3/sec_rec.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
src.print_index()

if ("2") //Search records
src.print_text("Please enter target name, ID, DNA, rank, or fingerprint.")
src.print_text("Please enter target name, ID, DNA, rank, fingerprint, or criminal status.")

src.menu = MENU_SEARCH_INPUT
return
Expand Down Expand Up @@ -587,6 +587,9 @@
var/list/datum/db_record/results = list()
for(var/datum/db_record/R as anything in data_core.general.records)
var/haystack = jointext(list(ckey(R["name"]), ckey(R["dna"]), ckey(R["id"]), ckey(R["fingerprint"]), ckey(R["rank"])), " ")
var/haystack_secure_addition = data_core.security.find_record("name", R["name"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why name and not ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure! ID probably would've been better! It's more or less my first dive into it at all, so a bit of a learning experience. I'll change it to use ID instead, shortly.

if(istype(haystack_secure_addition, /datum/db_record))
haystack = jointext(list(haystack, ckey(haystack_secure_addition["criminal"])), " ")
if(findtext(haystack, searchText))
results += R

Expand Down