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
+2 -2
View File
@@ -48,7 +48,7 @@
* target - the atom that just moved onto the `source` turf.
* oldLoc - the old location that `target` was at before moving onto `source`.
*/
/obj/machinery/mineral/proc/pickup_item(datum/source, atom/movable/target, atom/oldLoc)
/obj/machinery/mineral/proc/pickup_item(datum/source, atom/movable/target, direction)
SIGNAL_HANDLER
return
@@ -200,7 +200,7 @@
return dat
/obj/machinery/mineral/processing_unit/pickup_item(datum/source, atom/movable/target, atom/oldLoc)
/obj/machinery/mineral/processing_unit/pickup_item(datum/source, atom/movable/target, direction)
if(QDELETED(target))
return
if(istype(target, /obj/item/stack/ore))
+1 -1
View File
@@ -132,7 +132,7 @@
))
signal.send_to_receivers()
/obj/machinery/mineral/ore_redemption/pickup_item(datum/source, atom/movable/target, atom/oldLoc)
/obj/machinery/mineral/ore_redemption/pickup_item(datum/source, atom/movable/target, direction)
if(QDELETED(target))
return
if(!materials.mat_container || panel_open || !powered())
+1 -1
View File
@@ -11,7 +11,7 @@
needs_item_input = TRUE
processing_flags = START_PROCESSING_MANUALLY
/obj/machinery/mineral/unloading_machine/pickup_item(datum/source, atom/movable/target, atom/oldLoc)
/obj/machinery/mineral/unloading_machine/pickup_item(datum/source, atom/movable/target, direction)
if(QDELETED(target))
return
if(istype(target, /obj/structure/ore_box))