mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user