mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
This commit is contained in:
@@ -317,6 +317,10 @@ proc/listclearnulls(list/list)
|
||||
return (result + L.Copy(Li, 0))
|
||||
return (result + R.Copy(Ri, 0))
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields[field] == value)
|
||||
return R
|
||||
|
||||
//Move a single element from position fromIndex within a list, to position toIndex
|
||||
//This will preserve associations ~Carnie
|
||||
@@ -396,8 +400,3 @@ proc/listclearnulls(list/list)
|
||||
L.Swap(start++,end--)
|
||||
|
||||
return L
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields[field] == value)
|
||||
return R
|
||||
@@ -237,10 +237,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
if(oldname)
|
||||
//update the datacore records! This is goig to be a bit costly.
|
||||
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields["name"] == oldname)
|
||||
R.fields["name"] = newname
|
||||
break
|
||||
var/datum/data/record/R = find_record("name", oldname, L)
|
||||
|
||||
if(R)
|
||||
R.fields["name"] = newname
|
||||
|
||||
//update our pda and id if we have them on our person
|
||||
var/list/searching = GetAllContents(searchDepth = 3)
|
||||
|
||||
@@ -13,14 +13,10 @@
|
||||
/obj/effect/datacore/proc/manifest_modify(var/name, var/assignment)
|
||||
if(PDA_Manifest.len)
|
||||
PDA_Manifest.Cut()
|
||||
var/datum/data/record/foundrecord
|
||||
|
||||
var/real_title = assignment
|
||||
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
if (t)
|
||||
if(t.fields["name"] == name)
|
||||
foundrecord = t
|
||||
break
|
||||
var/datum/data/record/foundrecord = find_record("name", name, data_core.general)
|
||||
|
||||
var/list/all_jobs = get_job_datums()
|
||||
|
||||
|
||||
@@ -415,10 +415,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"]
|
||||
|
||||
Reference in New Issue
Block a user