Files
Bubberstation/code/datums/elements/point_of_interest.dm
SkyratBot 64cb64aae3 [MIRROR] Replace direct poi_list manipulation with element (#2117)
* 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).

* Replace direct poi_list manipulation with element

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2020-12-11 00:26:00 +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 ..()