Files
Bubberstation/code/datums/elements/point_of_interest.dm
SkyratBot e8d78089fc [MIRROR] [TM Candidate] Overhauls orbit and POI code to fix part of issue #61508 where players could observe /mob/living/new_player on the lobby. (#8339)
* [TM Candidate] Overhauls orbit and POI code to fix part of issue #61508 where players could observe /mob/living/new_player on the lobby.

* E

* Missed merge

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-24 18:16:17 +01:00

21 lines
753 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
// New players are abstract mobs assigned to people who are still in the lobby screen.
// As a result, they are not a valid POI and should never be a valid POI. If they
// somehow get this element attached to them, there's something we need to debug.
if(isnewplayer(target))
return ELEMENT_INCOMPATIBLE
SSpoints_of_interest.on_poi_element_added(target)
return ..()
/datum/element/point_of_interest/Detach(datum/target)
SSpoints_of_interest.on_poi_element_removed(target)
return ..()