[MIRROR] List literal components now store weakrefs in their list instead of the datum directly [MDB IGNORE] (#8891)

* List literal components now store weakrefs instead of the datum directly (#62004)

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>

* List literal components now store weakrefs in their list instead of the datum directly

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
This commit is contained in:
SkyratBot
2021-10-17 23:15:19 +01:00
committed by GitHub
co-authored by Watermelon914 Watermelon914
parent 4d2c1eb274
commit 778e030a1a
3 changed files with 14 additions and 4 deletions
@@ -53,7 +53,10 @@
if(islist(entry_ports[index].value) && get_list_count(entry_ports[index].value, max_list_count) >= max_list_count)
visible_message("[src] begins to overheat!")
return
new_literal += list(key_ports[index].value = entry_ports[index].value)
var/value_to_add = entry_ports[index].value
if(is_proper_datum(value_to_add))
value_to_add = WEAKREF(value_to_add)
new_literal[key_ports[index].value] = entry_ports[index].value
list_output.set_output(new_literal)
@@ -102,7 +102,10 @@
if(islist(value) && get_list_count(value, max_list_count) >= max_list_count)
visible_message("[src] begins to overheat!")
return
new_literal += list(value)
if(is_proper_datum(value))
new_literal += WEAKREF(value)
else
new_literal += list(value)
list_output.set_output(new_literal)