set parent.orbiters on register (#47344)

This commit is contained in:
4dplanner
2019-10-25 10:35:14 +01:00
committed by Rob Bailey
parent 1f1c2d9bdd
commit 2dc4bcad70
+6 -3
View File
@@ -14,19 +14,22 @@
orbiters = list()
var/atom/master = parent
master.orbiters = src
begin_orbit(orbiter, radius, clockwise, rotation_speed, rotation_segments, pre_rotation)
/datum/component/orbiter/PostTransfer()
if(!isatom(parent) || isarea(parent))
return COMPONENT_INCOMPATIBLE
/datum/component/orbiter/RegisterWithParent()
var/atom/target = parent
target.orbiters = src
while(ismovableatom(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/move_react)
target = target.loc
/datum/component/orbiter/UnregisterFromParent()
var/atom/target = parent
target.orbiters = null
while(ismovableatom(target))
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
target = target.loc