Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a overmap z failsafe #2525

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nsv13/code/__DEFINES/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ GLOBAL_LIST_INIT(overmap_impact_sounds, list('nsv13/sound/effects/ship/freespace
#define INTERIOR_READY 2
#define INTERIOR_DELETING 3
#define INTERIOR_DELETED 4

//Overmap flags
#define OVERMAP_FLAG_ZLEVEL_CARRIER (1<<0) //! This overmap is meant to carry a z with it, prompting restoration in certain cases.
6 changes: 6 additions & 0 deletions nsv13/code/modules/overmap/FTL/ftl_jump.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/datum/star_system/proc/add_ship(obj/structure/overmap/OM, turf/target_turf)
if(!system_contents.Find(OM))
system_contents += OM //Lets be safe while I cast some black magic.
var/did_restore_system = FALSE
if(!occupying_z && OM.z) //Does this system have a physical existence? if not, we'll set this now so that any inbound ships jump to the same Z-level that we're on.
if(!SSmapping.level_trait(OM.z, ZTRAIT_OVERMAP))
occupying_z = OM.get_reserved_z()
else
occupying_z = OM.z
did_restore_system = TRUE
else if(!occupying_z && ((OM.overmap_flags & OVERMAP_FLAG_ZLEVEL_CARRIER) || length(OM.mobs_in_ship))) //If someone is inside, or we always want it loaded, load it.
occupying_z = OM.get_reserved_z()
did_restore_system = TRUE
if(did_restore_system)
if(fleets.len)
for(var/datum/fleet/F in fleets)
if(!F.current_system)
Expand Down
2 changes: 2 additions & 0 deletions nsv13/code/modules/overmap/ai-skynet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,8 @@ Seek a ship thich we'll station ourselves around
var/ai_can_launch_fighters = FALSE //AI variable. Allows your ai ships to spawn fighter craft
var/list/ai_fighter_type = list()
var/ai_flags = AI_FLAG_DESTROYER
///Overmap bitflags
var/overmap_flags = NONE

var/list/holding_cargo = list() // list of objective datums. This station has cargo to deliver to the players as part of a courier objective
var/list/expecting_cargo = list() // list of objective datums. This station is expecting cargo delivered to them by the players as a part of a courier objective
Expand Down
1 change: 1 addition & 0 deletions nsv13/code/modules/overmap/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Proc to spool up a new Z-level for a player ship and assign it a treadmill.
var/turf/exit = get_turf(locate(round(world.maxx * 0.5, 1), round(world.maxy * 0.5, 1), world.maxz)) //Plop them bang in the center of the system.
var/obj/structure/overmap/OM = new _path(exit) //Ship'll pick up the info it needs, so just domp eet at the exit turf.
OM.reserved_z = world.maxz
OM.overmap_flags |= OVERMAP_FLAG_ZLEVEL_CARRIER
OM.current_system = SSstar_system.find_system(OM)
if(OM.role == MAIN_OVERMAP) //If we're the main overmap, we'll cheat a lil' and apply our status to all of the Zs under "station"
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
Expand Down