Files
Aurora.3/code/datums/weakref.dm
skull132 b4a34d27f9 Since < 511 is no longer supported, I nuked all of the refs to it. (#3037)
With the introduction of PR #3023 , 510 and lower are no longer supported. So I removed all compile time defines that were meant to allow for its support and bumped the compiler error guard.
2017-07-15 17:03:24 +03:00

22 lines
415 B
Plaintext

/datum
var/datum/weakref/weakref
/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