mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[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:
co-authored by
Watermelon914
Watermelon914
parent
4d2c1eb274
commit
778e030a1a
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user