I suspect the issue is with null entries in the records list.

This just nukes them all before processing with sorting. I looked over all of the list accesses, and they didn't appear to be index controlled, so this shouldn't break anything.
This commit is contained in:
skull132
2017-05-21 17:20:22 +03:00
committed by GitHub
parent 2e87db1883
commit c230dc0f5e
5 changed files with 27 additions and 5 deletions
+3 -3
View File
@@ -240,7 +240,7 @@ proc/listclearnulls(list/list)
//Mergesort: Specifically for record datums in a list.
/proc/sortRecord(var/list/datum/data/record/L, var/field = "name", var/order = 1)
if (!L)
return
return
var/list/target = L.Copy()
var/old_cmp_field = cmp_field
cmp_field = field
@@ -251,14 +251,14 @@ proc/listclearnulls(list/list)
//Mergesort: any value in a list
/proc/sortList(var/list/L)
if (!L)
return
return
var/list/target = L.Copy()
return sortTim(target, /proc/cmp_text_asc)
//Mergsorge: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sortNames(var/list/L)
if (!L)
return
return
var/list/target = L.Copy()
return sortTim(target, /proc/cmp_name_asc, FALSE)
+6
View File
@@ -417,6 +417,8 @@ proc/get_id_photo(var/mob/living/carbon/human/H, var/assigned_role)
G.fields["notes"] = "No notes found."
general += G
G.inDataCore = 1
return G
/datum/datacore/proc/CreateSecurityRecord(var/name, var/id, var/incidents)
@@ -435,6 +437,8 @@ proc/get_id_photo(var/mob/living/carbon/human/H, var/assigned_role)
R.fields["incidents"] = incidents
data_core.security += R
R.inDataCore = 1
return R
/datum/datacore/proc/CreateMedicalRecord(var/name, var/id)
@@ -456,6 +460,8 @@ proc/get_id_photo(var/mob/living/carbon/human/H, var/assigned_role)
M.fields["notes"] = "No notes found."
data_core.medical += M
M.inDataCore = 1
return M
/datum/datacore/proc/ResetPDAManifest()
+12 -1
View File
@@ -21,8 +21,19 @@
/datum/data/record
name = "record"
size = 5.0
var/list/fields = list( )
var/list/fields = list()
var/inDataCore = 0
/datum/data/record/Destroy()
// Just remove us from everywhere. So we don't have to keep track of which list
// we're in specifically.
if (inDataCore && data_core)
data_core.general -= src
data_core.medical -= src
data_core.security -= src
data_core.locked -= src
return ..()
/datum/data/text
name = "text"
+2
View File
@@ -453,6 +453,8 @@
src.active2 = R
src.screen = 4
R.inDataCore = 1
if (href_list["add_c"])
if (!( istype(src.active2, /datum/data/record) ))
return
+4 -1
View File
@@ -137,4 +137,7 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user)
data_core.security += S
data_core.locked += L
G.inDataCore = 1
M.inDataCore = 1
S.inDataCore = 1
L.inDataCore = 1