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