diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 1bd33435e25..0d981962cc0 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -8,6 +8,7 @@ var/last_parallax_shift //world.time of last update var/parallax_throttle = 0 //ds between updates var/parallax_movedir = 0 + var/new_parallax_movedir = 0 var/parallax_layers_max = 3 var/parallax_animate_timer @@ -154,7 +155,7 @@ var/area/areaobj = posobj.loc // Update the movement direction of the parallax if necessary (for shuttles) - set_parallax_movedir(areaobj.parallax_movedir) + set_parallax_movedir(C.new_parallax_movedir) var/force if(!C.previous_turf || (C.previous_turf.z != posobj.z)) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 40c0d83272e..daecd225355 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -106,6 +106,12 @@ ..() if((!(A) || !(src in A.locs))) return + + if(ismob(A)) + var/mob/M = A + if(M && M.client && M.client.new_parallax_movedir) + M.client.new_parallax_movedir = 0 + M.update_parallax_contents() if(destination_z && destination_x && destination_y) A.forceMove(locate(destination_x, destination_y, destination_z)) diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 6909c9289db..15c553b3f95 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -1,6 +1,6 @@ /turf/space/transit var/pushdirection // push things that get caught in the transit tile this direction - plane = TURF_LAYER + plane = PLANE_SPACE //Overwrite because we dont want people building rods in space. /turf/space/transit/attackby(obj/O as obj, mob/user as mob, params) diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index 67765ef8ac5..77c6a21dd0d 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -30,17 +30,22 @@ if(id_tag == "s_docking_airlock") INVOKE_ASYNC(src, .proc/lock) -/mob/onShuttleMove() +/mob/onShuttleMove(turf/oldT, turf/T1, rotation, travelDir) if(!move_on_shuttle) return 0 . = ..() if(!.) return - if(client) - if(buckled) - shake_camera(src, 2, 1) // turn it down a bit come on - else - shake_camera(src, 7, 1) + if(!client) + return + + if(buckled) + shake_camera(src, 2, 1) // turn it down a bit come on + else + shake_camera(src, 7, 1) + + client.new_parallax_movedir = travelDir ? WEST : NORTH + update_parallax_contents() /mob/living/carbon/onShuttleMove() . = ..() @@ -54,8 +59,16 @@ if(smooth) queue_smooth(src) +/mob/postDock(obj/docking_port/S1, transit, list/parallax_mobs) + if(!client) + return + if(transit) + parallax_mobs.Add(src) + return + client.new_parallax_movedir = 0 + update_parallax_contents() + /obj/machinery/door/airlock/postDock(obj/docking_port/stationary/S1) . = ..() if(!S1.lock_shuttle_doors && id_tag == "s_docking_airlock") INVOKE_ASYNC(src, .proc/unlock) - diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 2d3b03b967f..b2d710ba215 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -215,6 +215,7 @@ var/roundstart_move //id of port to send shuttle to at roundstart var/travelDir = 0 //direction the shuttle would travel in var/rebuildable = 0 //can build new shuttle consoles for this one + var/list/parallax_mobs = list() //mobs to unparallax var/obj/docking_port/stationary/destination var/obj/docking_port/stationary/previous @@ -358,7 +359,7 @@ var/obj/docking_port/stationary/S0 = get_docked() var/obj/docking_port/stationary/S1 = findTransitDock() if(S1) - if(dock(S1)) + if(dock(S1, , TRUE)) WARNING("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"].") else previous = S0 @@ -429,7 +430,7 @@ //this is the main proc. It instantly moves our mobile port to stationary port S1 //it handles all the generic behaviour, such as sanity checks, closing doors on the shuttle, stunning mobs, etc -/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1, force=FALSE) +/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1, force=FALSE, transit=FALSE) // Crashing this ship with NO SURVIVORS if(S1.get_docked() == src) remove_ripples() @@ -494,7 +495,7 @@ //move mobile to new location for(var/atom/movable/AM in T0) - AM.onShuttleMove(T0, T1, rotation) + AM.onShuttleMove(T0, T1, rotation, travelDir) if(rotation) T1.shuttleRotate(rotation) @@ -516,7 +517,15 @@ var/turf/T1 = A1 T1.postDock(S1) for(var/atom/movable/M in T1) - M.postDock(S1) + M.postDock(S1, transit, parallax_mobs) + + // For mobs who move away from a transiting shuttle for whatever reason (teleportation, jumping, etc) so that they don't get stuck parallaxing + if(!transit) + for(var/mob/M in parallax_mobs) + if(M.client && M.client.new_parallax_movedir) + M.client.new_parallax_movedir = 0 + M.update_parallax_contents() + parallax_mobs = list() loc = S1.loc dir = S1.dir