Merge pull request #6109 from Neerti/transfer_change

Makes transfer always occur if nobody is playing.
This commit is contained in:
Atermonera
2019-04-18 09:45:38 -08:00
committed by GitHub

View File

@@ -31,6 +31,24 @@ SUBSYSTEM_DEF(vote)
reset()
/datum/controller/subsystem/vote/proc/autotransfer()
// Before doing the vote, see if anyone is playing.
// If not, just do the transfer.
var/players_are_in_round = FALSE
for(var/a in player_list) // Mobs with clients attached.
var/mob/living/L = a
if(!istype(L)) // Exclude ghosts and other weird things.
continue
if(L.stat == DEAD) // Dead mobs aren't playing.
continue
// Everything else is, however.
players_are_in_round = TRUE
break
if(!players_are_in_round)
log_debug("The crew transfer shuttle was automatically called at vote time due to no players being present.")
init_shift_change(null, 1)
return
initiate_vote(VOTE_CREW_TRANSFER, "the server", 1)
log_debug("The server has called a crew transfer vote.")