Helper proc /proc/find_record(field, value, list/L)

It will search list/L for a /datum/data/record with fields[field] == value, and return it.

This removes a vast amount of copypasta (there's still so much left in there though). It also removes all the locate(\ref[record]) I could find, which were normal used with topic(), meaning it was susceptible to abuse.

Secbots, ed209s and turrets are now smarter with their record-checks. They now prefer to use our face-name rather than id-name. ICly, this is the bot using facial recognition. This fixes an issue where it'd try to use the name variable which could be in the format "Unknown (as their id name)" when they were disfigured, etc. causing record-lookup to fail.

Additionally, these bots will treat those without a valid record in the security database, to be treated like criminals.
This commit is contained in:
carnie
2013-08-10 10:10:45 +01:00
parent 37e76ffec4
commit ffa9bb51cd
21 changed files with 284 additions and 453 deletions
+1 -1
View File
@@ -2082,7 +2082,7 @@
var/dat = "<B>Showing Crew Manifest.</B><HR>"
dat += "<table cellspacing=5><tr><th>Name</th><th>Position</th></tr>"
for(var/datum/data/record/t in data_core.general)
dat += text("<tr><td>[]</td><td>[]</td></tr>", t.fields["name"], t.fields["rank"])
dat += "<tr><td>[t.fields["name"]]</td><td>[t.fields["rank"]]</td></tr>"
dat += "</table>"
usr << browse(dat, "window=manifest;size=440x410")
if("DNA")
+2 -4
View File
@@ -297,10 +297,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
/*Try and locate a record for the person being respawned through data_core.
This isn't an exact science but it does the trick more often than not.*/
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
for(var/datum/data/record/t in data_core.locked)
if(t.fields["id"]==id)
record_found = t//We shall now reference the record.
break
record_found = find_record("id", id, data_core.locked)
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]