From 9aab0deebc8f50e4bcb1cbe238162d6ca3213f2b Mon Sep 17 00:00:00 2001 From: Vladisvell Date: Thu, 28 Dec 2023 17:37:44 +0500 Subject: [PATCH] bugfix: Made forcemove consider area interactions --- code/game/atoms_movable.dm | 9 +++++++++ code/modules/awaymissions/gateway.dm | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index acb44796abc..944be00b9d5 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -286,6 +286,7 @@ /atom/movable/proc/forceMove(atom/destination) var/turf/old_loc = loc + var/area/old_area = get_area(src) loc = destination moving_diagonally = 0 @@ -294,12 +295,20 @@ for(var/atom/movable/AM in old_loc) AM.Uncrossed(src) + if(old_area) + old_area.Exited(src) + if(destination) destination.Entered(src) + var/area/new_area = get_area(destination) for(var/atom/movable/AM in destination) if(AM == src) continue AM.Crossed(src, old_loc) + + if(new_area && (old_area != new_area)) + new_area.Entered(src) + var/turf/oldturf = get_turf(old_loc) var/turf/destturf = get_turf(destination) var/old_z = (oldturf ? oldturf.z : null) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index aaba72ba2ae..b88f72bbeac 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -157,8 +157,6 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null) var/obj/effect/landmark/dest = pick(GLOB.awaydestinations) if(dest) moving_atom.forceMove(dest.loc) - var/area/entry_area = get_area(dest) - entry_area.Entered(moving_atom) moving_atom.dir = SOUTH use_power(5000) return @@ -277,10 +275,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null) if(exilecheck(L)) atom_say("Rejecting [moving_atom]: Exile implant detected in close proximity lifeform.") return - var/turf/destination = get_step(stationgate.loc, SOUTH) - moving_atom.forceMove(destination) - var/area/entry_area = get_area(destination) - entry_area.Entered(moving_atom) + moving_atom.forceMove(get_step(stationgate.loc, SOUTH)) moving_atom.setDir(SOUTH) if(ismob(moving_atom)) var/mob/M = moving_atom