diff --git a/_maps/map_files/BirdStation/BirdStation.dmm b/_maps/map_files/BirdStation/BirdStation.dmm index ed7cc9b0331..a37037d117d 100644 --- a/_maps/map_files/BirdStation/BirdStation.dmm +++ b/_maps/map_files/BirdStation/BirdStation.dmm @@ -224,7 +224,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -9715,7 +9715,7 @@ height = 5; id = "mining"; name = "mining shuttle"; - travelDir = 270; + port_angle = 270; width = 7 }, /obj/docking_port/stationary{ @@ -14003,7 +14003,7 @@ dir = 8; dwidth = 6; height = 18; - travelDir = 90; + port_angle = 90; width = 14; name = "Birdboat emergency shuttle" }, @@ -22482,7 +22482,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ @@ -23046,7 +23046,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 9 }, /obj/docking_port/stationary{ diff --git a/_maps/map_files/DreamStation/dreamstation04.dmm b/_maps/map_files/DreamStation/dreamstation04.dmm index 739ad0c6885..500e16b5288 100644 --- a/_maps/map_files/DreamStation/dreamstation04.dmm +++ b/_maps/map_files/DreamStation/dreamstation04.dmm @@ -2263,7 +2263,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -3495,7 +3495,7 @@ launch_status = 0; name = "NT Medical Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 35 }, /obj/docking_port/stationary{ @@ -3735,7 +3735,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 15 }, /turf/open/floor/plating, @@ -4547,7 +4547,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ @@ -63462,7 +63462,7 @@ height = 5; id = "mining"; name = "mining shuttle"; - travelDir = 90; + port_angle = 90; width = 7 }, /obj/docking_port/stationary{ diff --git a/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm b/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm index 0b1c471a9f8..fe4db2db29d 100644 --- a/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm +++ b/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm @@ -359,7 +359,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -2242,7 +2242,7 @@ id = "whiteship"; name = "NT Recovery White-Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 27 }, /obj/machinery/door/airlock/shuttle{ @@ -25041,7 +25041,7 @@ height = 5; id = "mining"; name = "mining shuttle"; - travelDir = 90; + port_angle = 90; width = 7 }, /obj/docking_port/stationary{ @@ -54562,7 +54562,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 15 }, /obj/docking_port/stationary{ @@ -54712,7 +54712,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ @@ -55196,7 +55196,7 @@ dir = 2; id = "pod1"; name = "escape pod 1"; - travelDir = 180 + port_angle = 180 }, /turf/open/floor/plasteel/shuttle, /area/shuttle/pod_1) @@ -55228,7 +55228,7 @@ dir = 2; id = "pod2"; name = "escape pod 2"; - travelDir = 180 + port_angle = 180 }, /turf/open/floor/plasteel/shuttle, /area/shuttle/pod_2) diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index bb988a84303..d7ace6a1a42 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -15535,7 +15535,7 @@ height = 5; id = "mining"; name = "mining shuttle"; - travelDir = 90; + port_angle = 90; width = 7 }, /obj/docking_port/stationary{ @@ -15787,7 +15787,7 @@ height = 5; id = "laborcamp"; name = "labor camp shuttle"; - travelDir = 90; + port_angle = 90; width = 9 }, /obj/docking_port/stationary{ @@ -39195,7 +39195,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 15 }, /obj/docking_port/stationary{ @@ -62398,7 +62398,7 @@ launch_status = 0; name = "NT Recovery White-Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 27 }, /obj/machinery/door/airlock/shuttle{ @@ -89561,7 +89561,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -90661,7 +90661,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ diff --git a/_maps/map_files/MiniStation/MiniStation.dmm b/_maps/map_files/MiniStation/MiniStation.dmm index 25d8fb7e6fa..37cb3acab72 100644 --- a/_maps/map_files/MiniStation/MiniStation.dmm +++ b/_maps/map_files/MiniStation/MiniStation.dmm @@ -4162,7 +4162,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 15 }, /obj/docking_port/stationary{ @@ -13195,7 +13195,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -14971,7 +14971,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ diff --git a/_maps/map_files/TgStation/tgstation.2.1.3.dmm b/_maps/map_files/TgStation/tgstation.2.1.3.dmm index 4cc0fd113ae..dcbcd1451ed 100644 --- a/_maps/map_files/TgStation/tgstation.2.1.3.dmm +++ b/_maps/map_files/TgStation/tgstation.2.1.3.dmm @@ -6618,7 +6618,7 @@ height = 5; id = "laborcamp"; name = "labor camp shuttle"; - travelDir = 90; + port_angle = 90; width = 9 }, /obj/docking_port/stationary{ @@ -17137,7 +17137,7 @@ height = 7; id = "arrival"; name = "arrival shuttle"; - travelDir = -90; + port_angle = -90; width = 15 }, /obj/docking_port/stationary{ @@ -33980,7 +33980,7 @@ id = "syndicate"; name = "syndicate infiltrator"; roundstart_move = "syndicate_away"; - travelDir = 180; + port_angle = 180; width = 18 }, /obj/docking_port/stationary{ @@ -39699,7 +39699,7 @@ height = 5; id = "mining"; name = "mining shuttle"; - travelDir = 90; + port_angle = 90; width = 7 }, /obj/docking_port/stationary{ @@ -58720,7 +58720,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5 }, /obj/docking_port/stationary{ @@ -58895,7 +58895,7 @@ launch_status = 0; name = "NT Medical Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 35 }, /obj/docking_port/stationary{ diff --git a/_maps/shuttles/emergency_birdboat.dmm b/_maps/shuttles/emergency_birdboat.dmm index b664d550b02..37d2f330629 100644 --- a/_maps/shuttles/emergency_birdboat.dmm +++ b/_maps/shuttles/emergency_birdboat.dmm @@ -265,7 +265,7 @@ dir = 8; dwidth = 6; height = 18; - travelDir = 90; + port_angle = 90; width = 14; timid = 1; name = "Birdboat emergency escape shuttle" diff --git a/_maps/shuttles/ferry_base.dmm b/_maps/shuttles/ferry_base.dmm index efe2532f80f..6316c87650e 100644 --- a/_maps/shuttles/ferry_base.dmm +++ b/_maps/shuttles/ferry_base.dmm @@ -70,7 +70,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5; timid = 1 }, diff --git a/_maps/shuttles/ferry_lighthouse.dmm b/_maps/shuttles/ferry_lighthouse.dmm index bce32374005..11f999d0918 100644 --- a/_maps/shuttles/ferry_lighthouse.dmm +++ b/_maps/shuttles/ferry_lighthouse.dmm @@ -198,7 +198,7 @@ name = "The Lighthouse"; roundstart_move = "ferry_away"; timid = 1; - travelDir = 180; + port_angle = 180; width = 16 }, /turf/open/floor/plasteel/shuttle, diff --git a/_maps/shuttles/ferry_meat.dmm b/_maps/shuttles/ferry_meat.dmm index a818725389b..117d96f4fde 100644 --- a/_maps/shuttles/ferry_meat.dmm +++ b/_maps/shuttles/ferry_meat.dmm @@ -127,7 +127,7 @@ id = "ferry"; name = "ferry shuttle"; roundstart_move = "ferry_away"; - travelDir = 180; + port_angle = 180; width = 5; timid = 1 }, diff --git a/_maps/shuttles/whiteship_box.dmm b/_maps/shuttles/whiteship_box.dmm index 34f09e6e87e..016e447f3ca 100644 --- a/_maps/shuttles/whiteship_box.dmm +++ b/_maps/shuttles/whiteship_box.dmm @@ -25,7 +25,7 @@ launch_status = 0; name = "NT Medical Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 35; timid = 1 }, diff --git a/_maps/shuttles/whiteship_meta.dmm b/_maps/shuttles/whiteship_meta.dmm index b5344f41982..f61efc28eca 100644 --- a/_maps/shuttles/whiteship_meta.dmm +++ b/_maps/shuttles/whiteship_meta.dmm @@ -41,7 +41,7 @@ launch_status = 0; name = "NT Recovery White-Ship"; roundstart_move = "whiteship_away"; - travelDir = 180; + port_angle = 180; width = 27; timid = 1 }, diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index 9d2abe528b4..259ff9170da 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -253,13 +253,22 @@ var/datum/subsystem/shuttle/SSshuttle // First, determine the size of the needed zone // Because of shuttle rotation, the "width" of the shuttle is not // always x. - //var/travel_dir = angle2dir(M.travelDir) + var/travel_dir = M.preferred_direction //var/coords = M.return_coords(0, 0, travel_dir) - // And then... stuff? + var/transit_width = 14 + var/transit_height = 14 + + // Shuttles travelling on their side have their dimensions swapped + // from our perspective + switch(travel_dir) + if(NORTH, SOUTH) + transit_width += M.width + transit_height += M.height + if(EAST, WEST) + transit_width += M.height + transit_height += M.width - var/transit_width = M.width + 14 - var/transit_height = M.height + 14 // Then find a place to put the zone var/list/proposed_zone @@ -299,15 +308,15 @@ var/datum/subsystem/shuttle/SSshuttle new_transit_dock.assigned_turfs = proposed_zone new_transit_dock.name = "Transit for [M.id]/[M.name]" - var/dockdir = 270 + M.travelDir - new_transit_dock.setDir(angle2dir(dockdir)) + var/dock_angle = dir2angle(M.preferred_direction) + M.port_angle + 180 + // Add 180, because ports point inwards, rather than outwards + new_transit_dock.setDir(angle2dir(dock_angle)) - var/spacedir = angle2dir(M.travelDir) for(var/i in new_transit_dock.assigned_turfs) var/turf/open/space/transit/T = i T.flags &= ~(UNUSED_TRANSIT_TURF) T.ChangeTurf(/turf/open/space/transit) - T.setDir(spacedir) + T.setDir(travel_dir) T.update_icon() M.assigned_transit = new_transit_dock diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 67ed2b40103..eed067395d9 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -182,7 +182,7 @@ width = 22 height = 11 dir = EAST - travelDir = -90 + port_angle = -90 roundstart_move = "emergency_away" var/sound_played = 0 //If the launch sound has been sent to all players on the shuttle itself diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 44c78306156..d84655cccbd 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -185,7 +185,11 @@ var/callTime = 150 //time spent in transit (deciseconds) var/ignitionTime = 100 // time spent "starting the engines" var/roundstart_move //id of port to send shuttle to at roundstart - var/travelDir = 0 //direction the shuttle would travel in + + // The direction the shuttle prefers to travel in + var/preferred_direction = NORTH + // And the angle from the front of the shuttle to the port + var/port_angle = 0 // used to be travelDir var/obj/docking_port/stationary/destination var/obj/docking_port/stationary/previous diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index b4077d52028..ba45fc0ca0c 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -20,7 +20,7 @@ var/list/blacklisted_cargo_types = typecacheof(list( callTime = 600 dir = WEST - travelDir = 90 + port_angle = 90 width = 12 dwidth = 5 height = 7