Fix: Only call autogamemode vote once.

This commit is contained in:
Leshana
2020-04-05 17:19:15 -04:00
parent c4a8aa2b7b
commit 6dc9ecd1af
2 changed files with 5 additions and 2 deletions

View File

@@ -88,14 +88,15 @@ var/global/datum/controller/subsystem/ticker/ticker
Master.SetRunLevel(RUNLEVEL_SETUP)
return
if(pregame_timeleft <= config.vote_autogamemode_timeleft)
SSvote.autogamemode() // Start the game mode vote
if(pregame_timeleft <= config.vote_autogamemode_timeleft && !SSvote.gamemode_vote_called)
SSvote.autogamemode() // Start the game mode vote (if we haven't had one already)
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
/datum/controller/subsystem/ticker/proc/setup_tick(resumed = FALSE)
if(!setup_choose_gamemode())
// It failed, go back to lobby state and re-send the welcome message
pregame_timeleft = config.pregame_time
SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
current_state = GAME_STATE_PREGAME
Master.SetRunLevel(RUNLEVEL_LOBBY)
pregame_welcome()

View File

@@ -13,6 +13,7 @@ SUBSYSTEM_DEF(vote)
var/duration
var/mode
var/question
var/gamemode_vote_called = FALSE // Have we had a gamemode vote this round? Only auto-call if we haven't
var/list/choices = list()
var/list/gamemode_names = list()
var/list/voted = list()
@@ -257,6 +258,7 @@ SUBSYSTEM_DEF(vote)
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3)
if(mode == VOTE_GAMEMODE && round_progressing)
gamemode_vote_called = TRUE
round_progressing = 0
to_world("<font color='red'><b>Round start has been delayed.</b></font>")