mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Shuttles now set themselves up upon being instantiated instead of relying on a monolithic proc in the shuttle controller. Shuttles can now be defined more cleanly on a per-map basis, as well. Accidentally fixes a broken admin shuttle.
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
|
|
var/global/datum/shuttle_controller/shuttle_controller
|
|
|
|
|
|
/datum/shuttle_controller
|
|
var/list/shuttles //maps shuttle tags to shuttle datums, so that they can be looked up.
|
|
var/list/process_shuttles //simple list of shuttles, for processing
|
|
|
|
/datum/shuttle_controller/proc/process()
|
|
//process ferry shuttles
|
|
for (var/datum/shuttle/ferry/shuttle in process_shuttles)
|
|
if (shuttle.process_state)
|
|
shuttle.process()
|
|
|
|
|
|
//This is called by gameticker after all the machines and radio frequencies have been properly initialized
|
|
/datum/shuttle_controller/proc/setup_shuttle_docks()
|
|
// for(var/shuttle_tag in shuttles)
|
|
// var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
|
for(var/shuttle_type in subtypesof(/datum/shuttle))
|
|
var/datum/shuttle/shuttle = shuttle_type
|
|
if(initial(shuttle.category) == shuttle_type)
|
|
continue
|
|
shuttle = new shuttle()
|
|
shuttle.init_docking_controllers()
|
|
shuttle.dock() //makes all shuttles docked to something at round start go into the docked state
|
|
|
|
for(var/obj/machinery/embedded_controller/C in machines)
|
|
if(istype(C.program, /datum/computer/file/embedded_program/docking))
|
|
C.program.tag = null //clear the tags, 'cause we don't need 'em anymore
|
|
|
|
/datum/shuttle_controller/New()
|
|
shuttles = list()
|
|
process_shuttles = list()
|
|
|