Let objects register to be informed when shuttles have been setup.

* Switch /obj/shuttle_connector to use it instead of the icky process hack.
This commit is contained in:
Leshana
2018-02-03 20:54:41 -05:00
parent df21594485
commit ca64667773
2 changed files with 17 additions and 9 deletions
+2 -9
View File
@@ -428,18 +428,13 @@
/obj/shuttle_connector
name = "shuttle connector"
var/shuttle_name //Text name of the shuttle to connect to
var/start_time = 60 SECONDS //After round start (needs to be some time, to let other destinations set up)
var/list/destinations //Make sure this STARTS with a destination that builds a route to one that always exists as an anchor.
/obj/shuttle_connector/initialize()
. = ..()
SSshuttles.OnDocksInitialized(CALLBACK(src, .proc/setup_routes))
processing_objects += src
/obj/shuttle_connector/process()
if(world.time < start_time)
return
/obj/shuttle_connector/proc/setup_routes()
if(destinations && shuttle_name)
var/datum/shuttle/web_shuttle/ES = shuttle_controller.shuttles[shuttle_name]
var/datum/shuttle_web_master/WM = ES.web_master
@@ -452,6 +447,4 @@
var/travel_delay = D.routes_to_make[type_to_link]
D.link_destinations(WM.get_destination_by_type(type_to_link), D.preferred_interim_area, travel_delay)
processing_objects -= src
qdel(src)