Files
4ab234f10c maploader / overmaps update - struct system, overmaps location bindings, misc backend improvements (#6403)
tl;dr level collections that can easily be logically restructured/moved
as necessary

will eventually be used for radio and overmaps location resolution.

this is the last part of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/4841
that has not yet been integrated.
this will be a draft for a while.

---------

Co-authored-by: LetterN <24603524+LetterN@users.noreply.github.com>
2025-11-06 17:49:23 -08:00

41 lines
1.1 KiB
Plaintext

SUBSYSTEM_DEF(turbolifts)
name = "Turbolifts"
subsystem_flags = SS_NO_INIT
wait = 1 SECONDS
var/static/list/moving_lifts = list()
var/list/currentrun
/datum/controller/subsystem/turbolifts/fire(resumed)
if (!resumed)
currentrun = moving_lifts.Copy()
for(var/liftref in currentrun)
currentrun -= liftref
if(world.time < currentrun[liftref])
continue
var/datum/turbolift/lift = locate(liftref)
if(lift.busy) // shouldn't happen as currentrun should contain valid, non-busy ones
continue
lift.busy = TRUE
var/floor_delay
if(!(floor_delay = lift.do_move()))
// we are done, remove ourself from the lift queue
moving_lifts[liftref] = null
moving_lifts -= liftref
if(lift.target_floor)
lift.target_floor.ext_panel.reset()
lift.target_floor = null
else
lift_is_moving(lift,floor_delay)
lift.busy = FALSE
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/turbolifts/proc/lift_is_moving(datum/turbolift/lift, floor_delay)
var/lift_ref = "[REF(lift)]"
moving_lifts[lift_ref] = world.time + floor_delay
if(currentrun[lift_ref])
currentrun[lift_ref] = world.time + floor_delay