Turning a few components into elements. (#12325)
* Turning a few components into elements. * eh
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
name = "modified gravity zone"
|
||||
setup_field_turfs = TRUE
|
||||
var/gravity_value = 0
|
||||
var/list/grav_components = list()
|
||||
var/list/modified_turfs = list()
|
||||
field_shape = FIELD_SHAPE_RADIUS_SQUARE
|
||||
|
||||
/datum/proximity_monitor/advanced/gravity/setup_field_turf(turf/T)
|
||||
. = ..()
|
||||
grav_components[T] = T.AddComponent(/datum/component/forced_gravity,gravity_value)
|
||||
T.AddElement(/datum/element/forced_gravity, gravity_value)
|
||||
modified_turfs[T] = gravity_value
|
||||
|
||||
/datum/proximity_monitor/advanced/gravity/cleanup_field_turf(turf/T)
|
||||
. = ..()
|
||||
var/datum/component/forced_gravity/G = grav_components[T]
|
||||
grav_components -= T
|
||||
if(G)
|
||||
qdel(G)
|
||||
if(isnull(modified_turfs[T]))
|
||||
return
|
||||
T.RemoveElement(/datum/element/forced_gravity, modified_turfs[T])
|
||||
modified_turfs -= T
|
||||
Reference in New Issue
Block a user