Skip to content

Commit

Permalink
Oops (Fixes midround additional overmap zlevel space tiles) (#2724)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaFire15 authored Dec 27, 2024
1 parent d7ba5e2 commit 2969e57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions nsv13/code/__HELPERS/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,24 @@ Another get_angle that works better with the looping edges of the overmap
.+=360

/**
* I am genuinely unsure what this is actually meant to do that normal z add does not do.
* If ANYONE actually knows if there is some important reason the procs I changed used this please tell me ~Delta
**/
* Loads a new z level and initializes the empty space, which is neccessary outside of initial initializations.
*/
/datum/controller/subsystem/mapping/proc/add_new_initialized_zlevel(name, traits = list(), z_type = /datum/space_level, orbital_body_type)
add_new_zlevel(name, traits)
SSatoms.InitializeAtoms(block(locate(1,1,world.maxz),locate(world.maxx,world.maxy,world.maxz)))
setup_map_transitions(z_list[world.maxz])

/**
* Generates a new z level with behavior specific to overmaps and returns its space level datum.
* Generates a new z level with behavior specific to overmaps and returns its space level datum. Does not init space tiles by itself.
*/
/datum/controller/subsystem/mapping/proc/add_new_overmap_zlevel()
. = add_new_zlevel("Overmap treadmill [length(z_list)+1]", ZTRAITS_OVERMAP)
setup_map_transitions(.)

/**
* Same as add_new_overmap_zlevel, but also initializes space. Should be the one used post initial inits.
*/
/datum/controller/subsystem/mapping/proc/add_new_initialized_overmap_zlevel()
. = add_new_zlevel("Overmap treadmill [length(z_list)+1]", ZTRAITS_OVERMAP)
SSatoms.InitializeAtoms(block(locate(1,1,world.maxz),locate(world.maxx,world.maxy,world.maxz)))
setup_map_transitions(.)
2 changes: 1 addition & 1 deletion nsv13/code/modules/overmap/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ Proc to spool up a new Z-level for a player ship and assign it a treadmill.
return reserved_z
if(ftl_drive)
if(!free_treadmills?.len)
var/datum/space_level/new_level = SSmapping.add_new_overmap_zlevel()
var/datum/space_level/new_level = SSmapping.add_new_initialized_overmap_zlevel()
reserved_z = new_level.z_value
else
var/_z = pick_n_take(free_treadmills)
Expand Down

0 comments on commit 2969e57

Please sign in to comment.