mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 15:42:35 +00:00
18 lines
358 B
Plaintext
18 lines
358 B
Plaintext
/datum/weakref
|
|
var/ref
|
|
|
|
/datum/weakref/New(datum/D)
|
|
ref = SOFTREF(D)
|
|
|
|
/datum/weakref/Destroy(force = 0)
|
|
crash_with("Some fuck is trying to [force ? "force-" : ""]delete a weakref!")
|
|
if (!force)
|
|
return QDEL_HINT_LETMELIVE // feck off
|
|
|
|
return ..()
|
|
|
|
/datum/weakref/proc/resolve()
|
|
var/datum/D = locate(ref)
|
|
if (!QDELETED(D) && D.weakref == src)
|
|
. = D
|