From 7dcd6907569c7143e0f8092716342d95a3f94947 Mon Sep 17 00:00:00 2001 From: Emmett Gaines Date: Thu, 12 Apr 2018 06:42:03 -0400 Subject: [PATCH] Removes some unnecesary vars on shuttles (#37041) * Removes some unnecesary vars on shuttles * Forgot to reapply unused transit turf flag --- _maps/RandomZLevels/snowdin.dmm | 8 ----- _maps/map_files/BoxStation/BoxStation.dmm | 4 --- .../map_files/Deltastation/DeltaStation2.dmm | 4 --- _maps/map_files/MetaStation/MetaStation.dmm | 3 -- _maps/map_files/Mining/Lavaland.dmm | 6 ---- _maps/map_files/OmegaStation/OmegaStation.dmm | 3 -- _maps/map_files/PubbyStation/PubbyStation.dmm | 4 --- _maps/map_files/generic/CentCom.dmm | 5 --- code/__DEFINES/shuttles.dm | 2 -- code/controllers/subsystem/shuttle.dm | 1 - code/game/turfs/change_turf.dm | 10 +++--- code/modules/mining/aux_base.dm | 2 -- code/modules/shuttle/docking.dm | 28 +++------------ code/modules/shuttle/on_move.dm | 7 ++-- code/modules/shuttle/shuttle.dm | 34 +++++++------------ 15 files changed, 26 insertions(+), 95 deletions(-) diff --git a/_maps/RandomZLevels/snowdin.dmm b/_maps/RandomZLevels/snowdin.dmm index 2d88ed442d6..932b3f3060a 100644 --- a/_maps/RandomZLevels/snowdin.dmm +++ b/_maps/RandomZLevels/snowdin.dmm @@ -9441,13 +9441,11 @@ width = 6 }, /obj/docking_port/stationary{ - baseturf_type = /turf/open/floor/engine; dir = 4; dwidth = 3; height = 6; id = "snowdin_excavation_top"; name = "snowdin excavation top"; - turf_type = /turf/open/floor/engine; width = 6 }, /turf/open/floor/plating, @@ -9478,13 +9476,11 @@ /area/awaymission/snowdin/post/mining_dock) "xP" = ( /obj/docking_port/stationary{ - baseturf_type = /turf/open/floor/plating/snowed; dir = 4; dwidth = 3; height = 6; id = "snowdin_excavation_down"; name = "snowdin excavation down"; - turf_type = /turf/open/floor/plating/snowed; width = 6 }, /turf/open/floor/plating, @@ -13821,13 +13817,11 @@ width = 5 }, /obj/docking_port/stationary{ - baseturf_type = /turf/open/floor/engine; dir = 4; dwidth = 2; height = 5; id = "snowdin_mining_top"; name = "snowdin mining top"; - turf_type = /turf/open/floor/engine; width = 5 }, /turf/open/floor/plating, @@ -13874,13 +13868,11 @@ "Kt" = ( /obj/docking_port/stationary{ area_type = /area/awaymission/snowdin/post/mining_dock; - baseturf_type = /turf/open/floor/engine; dir = 4; dwidth = 2; height = 5; id = "snowdin_mining_down"; name = "snowdin mining bottom"; - turf_type = /turf/open/floor/engine; width = 5 }, /turf/open/floor/plating, diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index e8cec42f9c8..1d28bafe994 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -2162,7 +2162,6 @@ height = 18; id = "emergency_home"; name = "BoxStation emergency evac bay"; - turf_type = /turf/open/space; width = 32 }, /turf/open/space/basic, @@ -8632,7 +8631,6 @@ height = 17; id = "syndicate_ne"; name = "northeast of station"; - turf_type = /turf/open/space; width = 23 }, /turf/open/space, @@ -50200,7 +50198,6 @@ height = 13; id = "ferry_home"; name = "port bay 2"; - turf_type = /turf/open/space; width = 5 }, /turf/open/space/basic, @@ -51481,7 +51478,6 @@ id = "aux_base_zone"; name = "aux base zone"; roundstart_template = /datum/map_template/shuttle/aux_base/default; - turf_type = /turf/open/floor/plating; width = 9 }, /turf/open/floor/plating, diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 0bf2b2e19b0..5a50cb32e89 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -1279,7 +1279,6 @@ id = "aux_base_zone"; name = "aux base zone"; roundstart_template = /datum/map_template/shuttle/aux_base/default; - turf_type = /turf/open/floor/plating; width = 9 }, /turf/open/floor/plating, @@ -1340,7 +1339,6 @@ height = 17; id = "syndicate_ne"; name = "northeast of station"; - turf_type = /turf/open/space; width = 23 }, /turf/open/space, @@ -1622,7 +1620,6 @@ height = 13; id = "ferry_home"; name = "port bay 2"; - turf_type = /turf/open/space; width = 5 }, /turf/open/space/basic, @@ -97303,7 +97300,6 @@ height = 18; id = "emergency_home"; name = "DeltaStation emergency evac bay"; - turf_type = /turf/open/space; width = 30 }, /turf/open/space/basic, diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 30db575f69d..06d10dd0f80 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -71373,7 +71373,6 @@ height = 13; id = "ferry_home"; name = "port bay 2"; - turf_type = /turf/open/space; width = 5 }, /turf/open/space/basic, @@ -73068,7 +73067,6 @@ id = "aux_base_zone"; name = "aux base zone"; roundstart_template = /datum/map_template/shuttle/aux_base/default; - turf_type = /turf/open/floor/plating; width = 9 }, /turf/open/floor/plating, @@ -77382,7 +77380,6 @@ height = 17; id = "syndicate_nw"; name = "northwest of station"; - turf_type = /turf/open/space; width = 23 }, /turf/open/space/basic, diff --git a/_maps/map_files/Mining/Lavaland.dmm b/_maps/map_files/Mining/Lavaland.dmm index 2119996ffaa..30bc85eb008 100644 --- a/_maps/map_files/Mining/Lavaland.dmm +++ b/_maps/map_files/Mining/Lavaland.dmm @@ -2304,13 +2304,11 @@ "gY" = ( /obj/docking_port/stationary{ area_type = /area/lavaland/surface/outdoors; - baseturf_type = /turf/open/lava/smooth/lava_land_surface; dir = 8; dwidth = 2; height = 5; id = "laborcamp_away"; name = "labor camp"; - turf_type = /turf/open/floor/plating/asteroid/basalt/lava_land_surface; width = 9 }, /turf/open/floor/plating/asteroid/basalt/lava_land_surface, @@ -3258,13 +3256,11 @@ "Uq" = ( /obj/docking_port/stationary{ area_type = /area/lavaland/surface/outdoors; - baseturf_type = /turf/open/lava/smooth/lava_land_surface; dir = 2; dwidth = 11; height = 22; id = "whiteship_lavaland"; name = "lavaland wastes"; - turf_type = /turf/open/floor/plating/asteroid/basalt/lava_land_surface; width = 35 }, /turf/open/floor/plating/asteroid/basalt/lava_land_surface, @@ -3272,13 +3268,11 @@ "Wp" = ( /obj/docking_port/stationary{ area_type = /area/lavaland/surface/outdoors; - baseturf_type = /turf/open/lava/smooth/lava_land_surface; dir = 8; dwidth = 3; height = 5; id = "mining_away"; name = "lavaland mine"; - turf_type = /turf/open/floor/plating/asteroid/basalt/lava_land_surface; width = 7 }, /turf/open/floor/plating/asteroid/basalt/lava_land_surface, diff --git a/_maps/map_files/OmegaStation/OmegaStation.dmm b/_maps/map_files/OmegaStation/OmegaStation.dmm index 96c04fb9805..2435429c32c 100644 --- a/_maps/map_files/OmegaStation/OmegaStation.dmm +++ b/_maps/map_files/OmegaStation/OmegaStation.dmm @@ -14055,7 +14055,6 @@ height = 18; id = "emergency_home"; name = "OmegaStation emergency evac bay"; - turf_type = /turf/open/space; width = 30 }, /turf/open/space/basic, @@ -30535,7 +30534,6 @@ height = 13; id = "ferry_home"; name = "port bay 2"; - turf_type = /turf/open/space; width = 5 }, /turf/open/space/basic, @@ -32878,7 +32876,6 @@ height = 17; id = "syndicate_sw"; name = "southwest of station"; - turf_type = /turf/open/space; width = 23 }, /turf/open/space, diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index a0edf1fc4b7..ace3a258ff4 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -3136,7 +3136,6 @@ height = 17; id = "syndicate_ne"; name = "northeast of station"; - turf_type = /turf/open/space; width = 23 }, /turf/open/space, @@ -28526,7 +28525,6 @@ height = 13; id = "ferry_home"; name = "port bay 2"; - turf_type = /turf/open/space; width = 5 }, /turf/open/space/basic, @@ -42697,7 +42695,6 @@ id = "aux_base_zone"; name = "aux base zone"; roundstart_template = /datum/map_template/shuttle/aux_base/default; - turf_type = /turf/open/floor/plating; width = 9 }, /turf/open/floor/plating, @@ -45563,7 +45560,6 @@ height = 22; id = "whiteship_home"; name = "monastery"; - turf_type = /turf/open/space; width = 35 }, /turf/open/space/basic, diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index 8e8916a0560..84002e5f814 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -3521,7 +3521,6 @@ height = 50; id = "emergency_syndicate"; name = "Syndicate Auxillary Shuttle Dock"; - turf_type = /turf/open/floor/plating/asteroid/snow; width = 50 }, /turf/open/floor/plating/asteroid/snow/airless, @@ -8473,13 +8472,11 @@ "xN" = ( /obj/docking_port/stationary{ area_type = /area/syndicate_mothership/control; - baseturf_type = /turf/open/space; dir = 1; dwidth = 3; height = 7; name = "escape pod loader"; roundstart_template = /datum/map_template/shuttle/assault_pod/default; - turf_type = /turf/open/floor/plating/airless; width = 7 }, /turf/open/floor/plating/airless, @@ -13390,7 +13387,6 @@ "My" = ( /obj/docking_port/stationary{ area_type = /area/syndicate_mothership; - baseturf_type = /turf/open/floor/plating/asteroid/snow; dheight = 1; dir = 8; dwidth = 12; @@ -13398,7 +13394,6 @@ id = "syndicate_away"; name = "syndicate recon outpost"; roundstart_template = /datum/map_template/shuttle/infiltrator/basic; - turf_type = /turf/open/floor/plating/asteroid/snow; width = 23 }, /turf/open/floor/plating/asteroid/snow/airless, diff --git a/code/__DEFINES/shuttles.dm b/code/__DEFINES/shuttles.dm index 306f316aa51..822e4fffd82 100644 --- a/code/__DEFINES/shuttles.dm +++ b/code/__DEFINES/shuttles.dm @@ -74,7 +74,5 @@ #define SHUTTLE_DOCKER_BLOCKED 3 //Shuttle defaults -#define SHUTTLE_DEFAULT_TURF_TYPE /turf/open/space -#define SHUTTLE_DEFAULT_BASETURF_TYPE /turf/open/space #define SHUTTLE_DEFAULT_SHUTTLE_AREA_TYPE /area/shuttle #define SHUTTLE_DEFAULT_UNDERLYING_AREA /area/space diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 17139fdea9a..64a4bc33b6b 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -552,7 +552,6 @@ SUBSYSTEM_DEF(shuttle) var/obj/docking_port/stationary/transit/new_transit_dock = new(midpoint) new_transit_dock.assigned_turfs = proposed_zone new_transit_dock.name = "Transit for [M.id]/[M.name]" - new_transit_dock.turf_type = transit_path new_transit_dock.owner = M new_transit_dock.assigned_area = A diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 3f7342e7f9f..355a2bd0da0 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -12,11 +12,11 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( var/thing = allowed_contents[i] qdel(thing, force=TRUE) - var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags) - - SSair.remove_from_active(newT) - newT.CalculateAdjacentTurfs() - SSair.add_to_active(newT,1) + if(turf_type) + var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags) + SSair.remove_from_active(newT) + newT.CalculateAdjacentTurfs() + SSair.add_to_active(newT,1) /turf/proc/copyTurf(turf/T) if(T.type != type) diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index ccd97844480..8acaf2e4955 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -174,7 +174,6 @@ interface with the mining shuttle at the landing site if a mobile beacon is also landing_zone.width = base_dock.width landing_zone.height = base_dock.height landing_zone.setDir(base_dock.dir) - landing_zone.turf_type = T.type landing_zone.area_type = A.type possible_destinations += "[landing_zone.id];" @@ -320,7 +319,6 @@ obj/docking_port/stationary/public_mining_dock Mport.width = SM.width Mport.height = SM.height Mport.setDir(dir) - Mport.turf_type = landing_spot.type Mport.area_type = A.type break diff --git a/code/modules/shuttle/docking.dm b/code/modules/shuttle/docking.dm index df41f1f9e64..c0052845c77 100644 --- a/code/modules/shuttle/docking.dm +++ b/code/modules/shuttle/docking.dm @@ -14,25 +14,11 @@ var/obj/docking_port/stationary/old_dock = get_docked() - // The turf that gets placed under where the shuttle moved from - var/underlying_turf_type = SHUTTLE_DEFAULT_TURF_TYPE - - // The baseturf that the gets assigned to the turf_type above - var/underlying_baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE - // The area that gets placed under where the shuttle moved from var/underlying_area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA - - // The baseturf cache is a typecache of what counts as a baseturf to be left behind - var/list/baseturf_cache if(old_dock) //Dock overwrites - underlying_turf_type = old_dock.turf_type - underlying_baseturf_type = old_dock.baseturf_type underlying_area_type = old_dock.area_type - baseturf_cache = old_dock.baseturf_cache - else - baseturf_cache = typecacheof(underlying_baseturf_type) /************************************************************************************************************** Both lists are associative with a turf:bitflag structure. (new_turfs bitflag space unused currently) @@ -70,7 +56,7 @@ remove_ripples() - . = preflight_check(old_turfs, new_turfs, areas_to_move, rotation, underlying_turf_type, baseturf_cache) + . = preflight_check(old_turfs, new_turfs, areas_to_move, rotation) if(.) return @@ -97,7 +83,7 @@ CHECK_TICK - cleanup_runway(new_dock, old_turfs, new_turfs, areas_to_move, moved_atoms, rotation, movement_direction, underlying_old_area, underlying_turf_type, underlying_baseturf_type) + cleanup_runway(new_dock, old_turfs, new_turfs, areas_to_move, moved_atoms, rotation, movement_direction, underlying_old_area) CHECK_TICK @@ -118,8 +104,6 @@ list/new_turfs, list/areas_to_move, rotation, - underlying_turf_type, - baseturf_cache, ) for(var/i in 1 to old_turfs.len) @@ -142,8 +126,8 @@ continue move_mode = moving_atom.beforeShuttleMove(newT, rotation, move_mode, src) //atoms - move_mode = oldT.fromShuttleMove(newT, underlying_turf_type, baseturf_cache, move_mode) //turfs - move_mode = newT.toShuttleMove(oldT, move_mode , src) //turfs + move_mode = oldT.fromShuttleMove(newT, move_mode) //turfs + move_mode = newT.toShuttleMove(oldT, move_mode, src) //turfs if(move_mode & MOVE_AREA) areas_to_move[old_area] = TRUE @@ -188,8 +172,6 @@ rotation, movement_direction, area/underlying_old_area, - underlying_turf_type, - underlying_baseturf_type, ) underlying_old_area.afterShuttleMove() @@ -210,7 +192,7 @@ continue var/turf/oldT = old_turfs[i] var/turf/newT = new_turfs[i] - newT.afterShuttleMove(oldT, underlying_turf_type, underlying_baseturf_type, rotation) //turfs + newT.afterShuttleMove(oldT, rotation) //turfs for(var/i in 1 to moved_atoms.len) CHECK_TICK diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index b24a1a8a02e..851c0cac5d0 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -6,7 +6,7 @@ All ShuttleMove procs go here // Called on every turf in the shuttle region, returns a bitflag for allowed movements of that turf // returns the new move_mode (based on the old) -/turf/proc/fromShuttleMove(turf/newT, turf_type, list/baseturf_cache, move_mode) +/turf/proc/fromShuttleMove(turf/newT, move_mode) if(!(move_mode & MOVE_AREA) || !isshuttleturf(src)) return move_mode @@ -66,13 +66,12 @@ All ShuttleMove procs go here return TRUE // Called on the new turf after everything has been moved -/turf/proc/afterShuttleMove(turf/oldT, turf_type, baseturf_type, rotation) +/turf/proc/afterShuttleMove(turf/oldT, rotation) //Dealing with the turf we left behind oldT.TransferComponents(src) var/shuttle_boundary = baseturfs.Find(/turf/baseturf_skipover/shuttle) if(shuttle_boundary) - var/depth = baseturfs.len - shuttle_boundary + 1 - oldT.ScrapeAway(depth) + oldT.ScrapeAway(baseturfs.len - shuttle_boundary + 1) if(rotation) shuttleRotate(rotation) //see shuttle_rotate.dm diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 2ae1d6db606..77dac0745bf 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -7,7 +7,6 @@ /obj/docking_port invisibility = INVISIBILITY_ABSTRACT icon = 'icons/obj/device.dmi' - //icon = 'icons/dirsquare.dmi' icon_state = "pinonfar" resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF @@ -22,8 +21,6 @@ var/dheight = 0 //position relative to covered area, parallel to dir var/area_type - var/turf_type - var/baseturf_type var/hidden = FALSE //are we invisible to shuttle navigation computers? //these objects are indestructible @@ -155,12 +152,8 @@ /obj/docking_port/stationary name = "dock" - turf_type = SHUTTLE_DEFAULT_TURF_TYPE - baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA - var/list/baseturf_cache - var/last_dock_time var/datum/map_template/shuttle/roundstart_template @@ -173,7 +166,6 @@ id = "[SSshuttle.stationary.len]" if(name == "dock") name = "dock[SSshuttle.stationary.len]" - baseturf_cache = typecacheof(baseturf_type) if(mapload) for(var/turf/T in return_turfs()) @@ -210,7 +202,6 @@ /obj/docking_port/stationary/transit name = "In Transit" - turf_type = /turf/open/space/transit var/list/turf/assigned_turfs = list() var/area/shuttle/transit/assigned_area var/obj/docking_port/mobile/owner @@ -222,8 +213,9 @@ /obj/docking_port/stationary/transit/proc/dezone() for(var/i in 1 to assigned_turfs.len) var/turf/T = assigned_turfs[i] - if(T.type == turf_type) - T.ChangeTurf(SHUTTLE_DEFAULT_TURF_TYPE, SHUTTLE_DEFAULT_BASETURF_TYPE) + if(istype(T, /turf/open/space/transit)) + T.ChangeTurf(/turf/open/space) + T.assemble_baseturfs(initial(T.baseturfs)) T.flags_1 |= UNUSED_TRANSIT_TURF_1 /obj/docking_port/stationary/transit/Destroy(force=FALSE) @@ -433,18 +425,11 @@ // Not in a fancy way, it just ceases. var/obj/docking_port/stationary/current_dock = get_docked() - var/turf_type = SHUTTLE_DEFAULT_TURF_TYPE - var/baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE var/underlying_area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA // If the shuttle is docked to a stationary port, restore its normal // "empty" area and turf - if(current_dock) - if(current_dock.turf_type) - turf_type = current_dock.turf_type - if(current_dock.baseturf_type) - baseturf_type = current_dock.baseturf_type - if(current_dock.area_type) - underlying_area_type = current_dock.area_type + if(current_dock && current_dock.area_type) + underlying_area_type = current_dock.area_type var/list/old_turfs = return_ordered_turfs(x, y, z, dir) var/area/underlying_area = locate(underlying_area_type) in GLOB.sortedAreas @@ -458,7 +443,14 @@ var/area/old_area = oldT.loc underlying_area.contents += oldT oldT.change_area(old_area, underlying_area) - oldT.empty(turf_type, baseturf_type) + oldT.empty(null) + + // Here we locate the bottomost shuttle boundary and remove all turfs above it + var/list/baseturf_cache = oldT.baseturfs + for(var/k in 1 to length(baseturf_cache)) + if(ispath(baseturf_cache[k], /turf/baseturf_skipover/shuttle)) + oldT.ScrapeAway(baseturf_cache.len - k + 1) + break qdel(src, force=TRUE)