Merge pull request #5014 from Citadel-Station-13/upstream-merge-34314

[MIRROR] Datum var cleanup
This commit is contained in:
LetterJay
2018-01-21 23:14:18 -06:00
committed by GitHub
15 changed files with 40 additions and 60 deletions
+4 -4
View File
@@ -1489,14 +1489,14 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
// \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 && istype(thing, /datum) && thing:use_tag && thing:tag ? "[thing:tag]" : "\ref[thing]")
// #define REF(thing) (thing && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")
/proc/REF(input)
if(istype(input, /datum))
var/datum/thing = input
if(thing.use_tag)
if(thing.datum_flags & DF_USE_TAG)
if(!thing.tag)
stack_trace("A ref was requested of an object with use_tag set but no tag: [thing]")
thing.use_tag = FALSE
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 "\ref[input]"