From 9bd92eddf770892ff11b1bfd4cbd9d6a57daa8fd Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 16 Jan 2018 09:33:43 -0500 Subject: [PATCH] Calling WEAKREF with a /datum/weakref returns the input (#34315) --- code/datums/weakrefs.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/datums/weakrefs.dm b/code/datums/weakrefs.dm index d8adba652c..f9602c0217 100644 --- a/code/datums/weakrefs.dm +++ b/code/datums/weakrefs.dm @@ -1,5 +1,7 @@ /proc/WEAKREF(datum/input) if(istype(input) && !QDELETED(input)) + if(istype(input, /datum/weakref)) + return input if(!input.weak_reference) input.weak_reference = new /datum/weakref(input) return input.weak_reference