From f4d6deaf23c527a06b2ce6357d29e886d418d71a Mon Sep 17 00:00:00 2001 From: RustingWithYou <63625389+RustingWithYou@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:50:58 +1200 Subject: [PATCH] Fixes Missing Open Space Landmarks (#18980) Open space landmarks were placed on the wrong z-levels for shuttles not using mapped zs. Fixes the issue of #18978 --- code/modules/overmap/ships/landable.dm | 30 +++++----- .../RustingWithYou - shuttlefix.yml | 58 +++++++++++++++++++ .../ships/konyang/air_konyang/air_konyang.dm | 1 + .../einstein_shuttle/einstein_shuttle.dm | 1 + .../izharshan/unathi_pirate_izharshan.dm | 2 +- 5 files changed, 78 insertions(+), 14 deletions(-) create mode 100644 html/changelogs/RustingWithYou - shuttlefix.yml diff --git a/code/modules/overmap/ships/landable.dm b/code/modules/overmap/ships/landable.dm index a6a964183c3..3b0327e901a 100644 --- a/code/modules/overmap/ships/landable.dm +++ b/code/modules/overmap/ships/landable.dm @@ -42,6 +42,15 @@ world.maxz++ map_z += world.maxz SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_Z, world.maxz) + var/turf/center_loc = locate(round(world.maxx/2), round(world.maxy/2), world.maxz) + landmark = new (center_loc, shuttle) + add_landmark(landmark, shuttle) + var/visitor_dir = fore_dir + for(var/landmark_name in list("FORE", "PORT", "AFT", "STARBOARD")) + var/turf/visitor_turf = get_ranged_target_turf(get_turf(landmark), visitor_dir, round(min(world.maxx/4, world.maxy/4))) + var/obj/effect/shuttle_landmark/visiting_shuttle/visitor_landmark = new (visitor_turf, landmark, landmark_name) + add_landmark(visitor_landmark) + visitor_dir = turn(visitor_dir, 90) if(multiz) new /obj/effect/landmark/map_data(locate(1, 1, world.maxz), (multiz + 1)) @@ -63,12 +72,7 @@ /obj/effect/overmap/visitable/ship/landable/populate_sector_objects() ..() var/datum/shuttle/shuttle_datum = SSshuttle.shuttles[shuttle] - //Finish open space setup - if(!use_mapped_z_levels) - var/turf/center_loc = locate(round(world.maxx/2), round(world.maxy/2), world.maxz) - landmark = new (center_loc, shuttle) - add_landmark(landmark, shuttle) - else + if(use_mapped_z_levels) var/obj/effect/shuttle_landmark/ship/ship_landmark = shuttle_datum.current_location if(!istype(ship_landmark)) stack_trace("Landable ship [src] with shuttle [shuttle] was mapped with a starting landmark type [ship_landmark.type], but should be /obj/effect/shuttle_landmark/ship.") @@ -79,12 +83,12 @@ landmark.shuttle_name = shuttle LAZYDISTINCTADD(initial_generic_waypoints, landmark.landmark_tag) // this is us being user-friendly: it means we register it properly regardless of whether the mapper put the tag in initial_restricted_waypoints - var/visitor_dir = fore_dir - for(var/landmark_name in list("FORE", "PORT", "AFT", "STARBOARD")) - var/turf/visitor_turf = get_ranged_target_turf(get_turf(landmark), visitor_dir, round(min(world.maxx/4, world.maxy/4))) - var/obj/effect/shuttle_landmark/visiting_shuttle/visitor_landmark = new (visitor_turf, landmark, landmark_name) - add_landmark(visitor_landmark) - visitor_dir = turn(visitor_dir, 90) + var/visitor_dir = fore_dir + for(var/landmark_name in list("FORE", "PORT", "AFT", "STARBOARD")) + var/turf/visitor_turf = get_ranged_target_turf(get_turf(landmark), visitor_dir, round(min(world.maxx/4, world.maxy/4))) + var/obj/effect/shuttle_landmark/visiting_shuttle/visitor_landmark = new (visitor_turf, landmark, landmark_name) + add_landmark(visitor_landmark) + visitor_dir = turn(visitor_dir, 90) //Configure shuttle datum GLOB.shuttle_moved_event.register(shuttle_datum, src, PROC_REF(on_shuttle_jump)) @@ -107,7 +111,7 @@ var/list/visitors // landmark -> visiting shuttle stationed there /obj/effect/shuttle_landmark/ship/Initialize(mapload, shuttle_name) - if(!mapload) + if(!src.shuttle_name) landmark_tag += "_[shuttle_name]" src.shuttle_name = shuttle_name . = ..() diff --git a/html/changelogs/RustingWithYou - shuttlefix.yml b/html/changelogs/RustingWithYou - shuttlefix.yml new file mode 100644 index 00000000000..1b57fae14ed --- /dev/null +++ b/html/changelogs/RustingWithYou - shuttlefix.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: RustingWithYou + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixes shuttle open space landmarks generating on the wrong z-levels." diff --git a/maps/away/ships/konyang/air_konyang/air_konyang.dm b/maps/away/ships/konyang/air_konyang/air_konyang.dm index e69c648fe35..fe47593ddf4 100644 --- a/maps/away/ships/konyang/air_konyang/air_konyang.dm +++ b/maps/away/ships/konyang/air_konyang/air_konyang.dm @@ -57,6 +57,7 @@ defer_initialisation = TRUE /obj/effect/shuttle_landmark/ship/air_konyang + shuttle_name = "Air Konyang Transport" landmark_tag = "nav_air_konyang_start" /obj/effect/shuttle_landmark/air_konyang_transit diff --git a/maps/away/ships/konyang/einstein_shuttle/einstein_shuttle.dm b/maps/away/ships/konyang/einstein_shuttle/einstein_shuttle.dm index d7d29449576..81753770946 100644 --- a/maps/away/ships/konyang/einstein_shuttle/einstein_shuttle.dm +++ b/maps/away/ships/konyang/einstein_shuttle/einstein_shuttle.dm @@ -99,6 +99,7 @@ defer_initialisation = TRUE /obj/effect/shuttle_landmark/ship/einstein_shuttle + shuttle_name = "Einstein Shuttle" landmark_tag = "nav_start_einstein" /obj/effect/shuttle_landmark/einstein_shuttle_transit diff --git a/maps/away/ships/unathi_pirate/izharshan/unathi_pirate_izharshan.dm b/maps/away/ships/unathi_pirate/izharshan/unathi_pirate_izharshan.dm index f5e28a041c8..bb1285ad456 100644 --- a/maps/away/ships/unathi_pirate/izharshan/unathi_pirate_izharshan.dm +++ b/maps/away/ships/unathi_pirate/izharshan/unathi_pirate_izharshan.dm @@ -13,7 +13,6 @@ spawn_weight_sector_dependent = list(SECTOR_UUEOAESA = 0.5, SECTOR_NRRAHRAHUL = 0.5) //Rarer due to actual government/military presence unit_test_groups = list(1) - template_flags = TEMPLATE_FLAG_SPAWN_GUARANTEED /singleton/submap_archetype/unathi_pirate_izharshan map = "Izharshan Shuttle" @@ -111,6 +110,7 @@ defer_initialisation = TRUE /obj/effect/shuttle_landmark/ship/unathi_pirate_izharshan + shuttle_name = "Izharshan Freighter" landmark_tag = "nav_izharshan_space" /obj/effect/shuttle_landmark/izharshan_transit