Skip to content

Commit

Permalink
TGS Test Merge (#6819)
Browse files Browse the repository at this point in the history
  • Loading branch information
lordme authored and lordme committed Oct 25, 2024
2 parents 9e83d7a + 12d1a57 commit 3c63031
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ SUBSYSTEM_DEF(ticker)
fire()

/datum/controller/subsystem/ticker/proc/process_pregame()
var/citest = FALSE
#ifdef CITESTING
citest = TRUE
#endif
if(isnull(timeLeft))
timeLeft = max(0,start_at - world.time)
if(start_immediately)
Expand All @@ -143,10 +147,27 @@ SUBSYSTEM_DEF(ticker)
return
timeLeft -= wait
if(timeLeft <= 0)
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
if(start_immediately)
fire()
if((how_many_players_have_readied_up() > 0) || (citest))
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
if(start_immediately)
fire()
else
handle_no_players_ready()
return

/datum/controller/subsystem/ticker/proc/how_many_players_have_readied_up()
var/ready = FALSE
for(var/client/C in GLOB.clients)
if(istype(C.mob, /mob/new_player))
var/mob/new_player/p = C.mob
ready += p.ready
return ready

/datum/controller/subsystem/ticker/proc/handle_no_players_ready()
to_chat(world, SPAN_ANNOUNCE("No Players are ready to play, delaying round start."))
start_at = world.time + 1 MINUTE
timeLeft = max(0,start_at - world.time)

/datum/controller/subsystem/ticker/proc/Reboot(reason, end_string, delay)
set waitfor = FALSE
Expand Down

0 comments on commit 3c63031

Please sign in to comment.