Refactors move procs to support multitle objects (#59658)

Enter(), Entered(), Exit() and Exited() all passed the old loc forward, but everything except a single a case cared about the direction of the movement more than about the specific source.
Since moving multi-tile objects will have multiple sources of movement but a single direction, this change makes it easier to track their movement.

Cleaned up a lot of code around and made proc inputs compatible.

I'll add opacity support for multi-tile objects in a different PR after this is merged, as this has grown large enough and I don't want to compromise the reviewability.

Tested this locally and as expected it didn't impair movement nor produced any runtimes.
This commit is contained in:
Rohesie
2021-06-20 18:55:37 -03:00
committed by GitHub
parent 3f244b211d
commit e03cd1aada
83 changed files with 350 additions and 301 deletions
+4 -4
View File
@@ -34,10 +34,10 @@
return parent.field_turf_crossed(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_turf/on_uncrossed(datum/source, atom/movable/AM)
/obj/effect/abstract/proximity_checker/advanced/field_turf/on_uncrossed(datum/source, atom/movable/gone, direction)
. = ..()
if(parent)
return parent.field_turf_uncrossed(AM, src)
return parent.field_turf_uncrossed(gone, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_edge
@@ -55,9 +55,9 @@
return parent.field_edge_crossed(AM, src)
return TRUE
/obj/effect/abstract/proximity_checker/advanced/field_edge/on_uncrossed(datum/source, atom/movable/AM)
/obj/effect/abstract/proximity_checker/advanced/field_edge/on_uncrossed(datum/source, atom/movable/gone, direction)
if(parent)
return parent.field_edge_uncrossed(AM, src)
return parent.field_edge_uncrossed(gone, src)
return TRUE
/proc/is_turf_in_field(turf/T, datum/proximity_monitor/advanced/F) //Looking for ways to optimize this!