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 14:55:37 -07:00
committed by GitHub
parent 3f244b211d
commit e03cd1aada
83 changed files with 350 additions and 301 deletions
+4 -4
View File
@@ -167,15 +167,15 @@
RegisterSignal(newloc, COMSIG_ATOM_EXITED, .proc/check_exit)
listeningTo = newloc
/obj/item/assembly/infra/proc/check_exit(datum/source, atom/movable/offender)
/obj/item/assembly/infra/proc/check_exit(datum/source, atom/movable/gone, direction)
SIGNAL_HANDLER
if(QDELETED(src))
return
if(offender == src || istype(offender,/obj/effect/beam/i_beam))
if(src == gone || istype(gone, /obj/effect/beam/i_beam))
return
if (offender && isitem(offender))
var/obj/item/I = offender
if(isitem(gone))
var/obj/item/I = gone
if (I.item_flags & ABSTRACT)
return
INVOKE_ASYNC(src, .proc/refreshBeam)