Cut down on z-level generation for shuttles (#13573)

This commit is contained in:
Wildkins
2022-04-19 05:42:21 -04:00
committed by GitHub
parent a7ad5e2d1a
commit 24f31ef511
6 changed files with 19 additions and 7 deletions
+8 -3
View File
@@ -7,6 +7,7 @@
var/obj/effect/shuttle_landmark/ship/landmark // Record our open space landmark for easy reference.
var/multiz = 0 // Index of multi-z levels, starts at 0
var/status = SHIP_STATUS_LANDED
var/subshuttle = FALSE // TRUE/FALSE: Is this a ship that starts docked to another ship?
icon_state = "shuttle"
moving_state = "shuttle_moving"
@@ -34,8 +35,12 @@
// We autobuild our z levels.
/obj/effect/overmap/visitable/ship/landable/find_z_levels()
for(var/i = 0 to multiz)
world.maxz++
if(isStationLevel(z) || multiz || subshuttle)
// If we're not on station and not multi-z or inside an existing ship, then we already had a z-level generated for us; let's use that
for(var/i = 0 to multiz)
world.maxz++
map_z += world.maxz
else
map_z += world.maxz
var/turf/center_loc = locate(round(world.maxx/2), round(world.maxy/2), world.maxz)
@@ -168,4 +173,4 @@
if(SHIP_STATUS_TRANSIT)
return "Maneuvering under secondary thrust."
if(SHIP_STATUS_OVERMAP)
return "In open space."
return "In open space."