Adds an overmap helper to find what sector you're in

This commit is contained in:
Aronai Sieyes
2020-04-27 10:34:28 -04:00
parent c9086829ec
commit dcf88640ee
14 changed files with 20 additions and 159 deletions
+3 -3
View File
@@ -55,14 +55,14 @@
if(!istype(docking_controller))
log_error("Could not find docking controller for shuttle waypoint '[name]', docking tag was '[docking_tag]'.")
if(using_map.use_overmap)
var/obj/effect/overmap/visitable/location = map_sectors["[z]"]
var/obj/effect/overmap/visitable/location = get_overmap_sector(z)
if(location && location.docking_codes)
docking_controller.docking_codes = location.docking_codes
/obj/effect/shuttle_landmark/forceMove()
var/obj/effect/overmap/visitable/map_origin = map_sectors["[z]"]
var/obj/effect/overmap/visitable/map_origin = get_overmap_sector(z)
. = ..()
var/obj/effect/overmap/visitable/map_destination = map_sectors["[z]"]
var/obj/effect/overmap/visitable/map_destination = get_overmap_sector(z)
if(map_origin != map_destination)
if(map_origin)
map_origin.remove_landmark(src, shuttle_restricted)
+1 -1
View File
@@ -30,7 +30,7 @@
if(active_docking_controller)
set_docking_codes(active_docking_controller.docking_codes)
else if(global.using_map.use_overmap)
var/obj/effect/overmap/visitable/location = map_sectors["[current_location.z]"]
var/obj/effect/overmap/visitable/location = get_overmap_sector(get_z(current_location))
if(location && location.docking_codes)
set_docking_codes(location.docking_codes)
dock()
+1 -1
View File
@@ -166,7 +166,7 @@ GLOBAL_LIST_BOILERPLATE(papers_dockingcode, /obj/item/weapon/paper/dockingcodes)
var/dockingcodes = null
var/z_to_check = codes_from_z ? codes_from_z : z
if(using_map.use_overmap)
var/obj/effect/overmap/visitable/location = map_sectors["[z_to_check]"]
var/obj/effect/overmap/visitable/location = get_overmap_sector(z_to_check)
if(location && location.docking_codes)
dockingcodes = location.docking_codes