[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
+6 -2
View File
@@ -46,9 +46,13 @@
* Casts to the port's datatype (e.g. number -> string), and assumes this can be done.
*/
/datum/port/proc/set_value(value, force = FALSE)
if(isweakref(value))
var/datum/weakref/reference_to_obj = value
value = reference_to_obj.resolve()
if(src.value != value || force)
if(isatom(value))
UnregisterSignal(value, COMSIG_PARENT_QDELETING)
if(isatom(src.value))
UnregisterSignal(src.value, COMSIG_PARENT_QDELETING)
src.value = datatype_handler.convert_value(src, value, force)
if(isatom(value))
RegisterSignal(value, COMSIG_PARENT_QDELETING, .proc/null_value)