Files
Bubberstation/code/datums/elements/point_of_interest.dm
Jared-Fogle 0a77d27a1b Replace direct poi_list manipulation with element (#55416)
Replaces GLOB.poi_list |= src and GLOB.poi_list -= src with an element that handles it directly.

More consistent code, especially when a lot of code couldn't decide how to add/remove (some |=, some -=, some .Remove, etc).
2020-12-10 23:30:25 +00:00

14 lines
388 B
Plaintext

/// Designates the atom as a "point of interest", meaning it can be directly orbited
/datum/element/point_of_interest
element_flags = ELEMENT_DETACH
/datum/element/point_of_interest/Attach(datum/target)
if (!isatom(target))
return ELEMENT_INCOMPATIBLE
GLOB.poi_list += target
return ..()
/datum/element/point_of_interest/Detach(datum/target)
GLOB.poi_list -= target
return ..()