Fixes vv of things in lists (#79282)

I forgot name could be a number for list indexes, so this switches to
using `in` instead.


Also improves the error message a little bit so reported issues can at
least say *something* about the value throwing an error.

fixes #79280
fixes #79264
This commit is contained in:
Emmett Gaines
2023-10-26 23:45:58 -04:00
committed by GitHub
parent ad4bff7687
commit fdbddfb12b
2 changed files with 5 additions and 5 deletions
@@ -30,7 +30,7 @@
// This is split into a seperate proc mostly to make errors that happen not break things too much
/proc/_debug_variable_value(name, value, level, datum/owner, sanitize, display_flags)
. = "<font color='red'>DISPLAY_ERROR</font>"
. = "<font color='red'>DISPLAY_ERROR:</font> ([value] [REF(value)])" // Make sure this line can never runtime
if(isnull(value))
return "<span class='value'>null</span>"
@@ -64,13 +64,13 @@
var/datum/datum_value = value
return datum_value.debug_variable_value(name, level, owner, sanitize, display_flags)
if(islist(value) || GLOB.vv_special_lists[name]) // Some special lists arent detectable as a list through istype
if(islist(value) || (name in GLOB.vv_special_lists)) // Some special lists arent detectable as a list through istype
var/list/list_value = value
var/list/items = list()
// This is becuse some lists either dont count as lists or a locate on their ref will return null
var/link_vars = "Vars=[REF(value)]"
if(GLOB.vv_special_lists[name])
if(name in GLOB.vv_special_lists)
link_vars = "Vars=[REF(owner)];special_varname=[name]"
if (!(display_flags & VV_ALWAYS_CONTRACT_LIST) && list_value.len > 0 && list_value.len <= (IS_NORMAL_LIST(list_value) ? VV_NORMAL_LIST_NO_EXPAND_THRESHOLD : VV_SPECIAL_LIST_NO_EXPAND_THRESHOLD))