Files
Bubberstation/code/__HELPERS/ref.dm
SkyratBot 375fea374a [MIRROR] Optimizes qdel related things (slight init time savings) [MDB IGNORE] (#17240)
* Optimizes qdel related things (slight init time savings)

* lang holder

* cleanup custom spawners slightly

* ref update

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-10-30 23:15:38 -04:00

16 lines
630 B
Plaintext

/**
* \ref behaviour got changed in 512 so this is necesary to replicate old behaviour.
* If it ever becomes necesary to get a more performant REF(), this lies here in wait
* #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing))
**/
/proc/REF(input)
if(isdatum(input))
var/datum/thing = input
if(thing.datum_flags & DF_USE_TAG)
if(!thing.tag)
stack_trace("A ref was requested of an object with DF_USE_TAG set but no tag: [thing]")
thing.datum_flags &= ~DF_USE_TAG
else
return "\[[url_encode(thing.tag)]\]"
return text_ref(input)