From 1d17fae2f13a71df15df862cc6fa155d355025c8 Mon Sep 17 00:00:00 2001 From: Emmett Gaines Date: Tue, 17 Jul 2018 03:35:05 -0400 Subject: [PATCH] Fixes mech equipment being unremovable (#39161) And probably other issues with objects in objects moving out --- code/game/atoms_movable.dm | 16 ++++------------ code/game/turfs/turf.dm | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index e0866a927b9..9ebcfbca285 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -151,19 +151,11 @@ if(!direct) direct = get_dir(src, newloc) setDir(direct) - - if(!loc.Exit(src)) - return - for(var/i in loc) - if(i == src) - continue - var/atom/movable/thing = i - if(!thing.Uncross(src, newloc)) - if(thing.flags_1 & ON_BORDER_1) - Bump(thing) - return - if(!newloc.Enter(src)) + if(!loc.Exit(src, newloc)) + return + + if(!newloc.Enter(src, src.loc)) return // Past this is the point of no return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 5d995069319..89e7eab8bc5 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -149,7 +149,7 @@ firstbump = src else for(var/i in contents) - if(i == mover) // Multi tile objects + if(i == mover || i == mover.loc) // Multi tile objects and moving out of other objects continue var/atom/movable/thing = i if(thing.Cross(mover)) @@ -161,6 +161,19 @@ return FALSE return TRUE +/turf/Exit(atom/movable/mover, atom/newloc) + . = ..() + if(!.) + return FALSE + for(var/i in contents) + if(i == mover) + continue + var/atom/movable/thing = i + if(!thing.Uncross(mover, newloc)) + if(thing.flags_1 & ON_BORDER_1) + mover.Bump(thing) + return FALSE + /turf/Entered(atom/movable/AM) ..() if(explosion_level && AM.ex_check(explosion_id))