diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 58a1bc532fa..05b3c5d1283 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -139,21 +139,29 @@ if(destination) if(pulledby) pulledby.stop_pulling() + var/atom/oldloc = loc - var/same_loc = oldloc == destination.loc - if(oldloc && !same_loc) - oldloc.Exited(src, destination) - loc = destination - if(!same_loc) - destination.Entered(src, oldloc) + var/same_loc = oldloc == destination var/area/old_area = get_area(oldloc) var/area/destarea = get_area(destination) - if(old_area != destarea) - destarea.Entered(src) + + if(oldloc && !same_loc) + oldloc.Exited(src, destination) + if(old_area) + old_area.Exited(src, destination) + + loc = destination + + if(!same_loc) + destination.Entered(src, oldloc) + if(destarea && old_area != destarea) + destarea.Entered(src, oldloc) + for(var/atom/movable/AM in destination) if(AM == src) continue AM.Crossed(src) + Moved(oldloc, 0) return 1 return 0 @@ -408,4 +416,4 @@ if(ex_id in acted_explosions) return FALSE acted_explosions += ex_id - return TRUE \ No newline at end of file + return TRUE