diff --git a/code/datums/components/stationloving.dm b/code/datums/components/stationloving.dm index a0080254fa4..c31109ea6bc 100644 --- a/code/datums/components/stationloving.dm +++ b/code/datums/components/stationloving.dm @@ -19,7 +19,7 @@ src.allow_item_destruction = allow_item_destruction // Just in case something is being created outside of station/centcom - if(!destination_in_bounds(parent)) + if(!atom_in_bounds(parent)) relocate() /datum/component/stationloving/InheritComponent(datum/component/stationloving/newc, original, inform_admins, allow_death) @@ -52,7 +52,7 @@ /datum/component/stationloving/proc/on_parent_z_change(datum/source, turf/old_turf, turf/new_turf) SIGNAL_HANDLER - if(destination_in_bounds(parent)) + if(atom_in_bounds(parent)) return var/turf/current_turf = get_turf(parent) @@ -73,11 +73,11 @@ return COMPONENT_BLOCK_MARK_RETRIEVAL -/// Checks whether a given destination is within bounds. Returns TRUE if it is, FALSE if it isn't. -/datum/component/stationloving/proc/destination_in_bounds(atom/destination) +/// Checks whether a given atom's turf is within bounds. Returns TRUE if it is, FALSE if it isn't. +/datum/component/stationloving/proc/atom_in_bounds(atom/atom_to_check) var/static/list/allowed_shuttles = typecacheof(list(/area/shuttle/syndicate, /area/shuttle/escape, /area/shuttle/pod_1, /area/shuttle/pod_2, /area/shuttle/pod_3, /area/shuttle/pod_4)) var/static/list/disallowed_centcom_areas = typecacheof(list(/area/abductor_ship, /area/awaymission/errorroom)) - var/turf/destination_turf = get_turf(destination) + var/turf/destination_turf = get_turf(atom_to_check) if (!destination_turf) return FALSE var/area/destination_area = destination_turf.loc @@ -87,7 +87,7 @@ if (is_type_in_typecache(destination_area, disallowed_centcom_areas)) return FALSE return TRUE - if (is_reserved_level(destination.z)) + if (is_reserved_level(destination_turf.z)) if (is_type_in_typecache(destination_area, allowed_shuttles)) return TRUE diff --git a/code/modules/shuttle/docking.dm b/code/modules/shuttle/docking.dm index 80536df0d8a..66f4f2e1b06 100644 --- a/code/modules/shuttle/docking.dm +++ b/code/modules/shuttle/docking.dm @@ -139,6 +139,14 @@ var/turf/oldT = old_turfs[i] var/turf/newT = new_turfs[i] var/move_mode = old_turfs[oldT] + + if(move_mode & MOVE_TURF) + oldT.onShuttleMove(newT, movement_force, movement_direction) //turfs + + if(move_mode & MOVE_AREA) + var/area/shuttle_area = oldT.loc + shuttle_area.onShuttleMove(oldT, newT, underlying_old_area) //areas + if(move_mode & MOVE_CONTENTS) for(var/k in oldT) var/atom/movable/moving_atom = k @@ -147,12 +155,6 @@ moving_atom.onShuttleMove(newT, oldT, movement_force, movement_direction, old_dock, src) //atoms moved_atoms[moving_atom] = oldT - if(move_mode & MOVE_TURF) - oldT.onShuttleMove(newT, movement_force, movement_direction) //turfs - - if(move_mode & MOVE_AREA) - var/area/shuttle_area = oldT.loc - shuttle_area.onShuttleMove(oldT, newT, underlying_old_area) //areas /obj/docking_port/mobile/proc/cleanup_runway(obj/docking_port/stationary/new_dock, list/old_turfs, list/new_turfs, list/areas_to_move, list/moved_atoms, rotation, movement_direction, area/underlying_old_area) underlying_old_area.afterShuttleMove()