mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Fix: Only call autogamemode vote once.
This commit is contained in:
@@ -88,14 +88,15 @@ var/global/datum/controller/subsystem/ticker/ticker
|
|||||||
Master.SetRunLevel(RUNLEVEL_SETUP)
|
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(pregame_timeleft <= config.vote_autogamemode_timeleft)
|
if(pregame_timeleft <= config.vote_autogamemode_timeleft && !SSvote.gamemode_vote_called)
|
||||||
SSvote.autogamemode() // Start the game mode vote
|
SSvote.autogamemode() // Start the game mode vote (if we haven't had one already)
|
||||||
|
|
||||||
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
|
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
|
||||||
/datum/controller/subsystem/ticker/proc/setup_tick(resumed = FALSE)
|
/datum/controller/subsystem/ticker/proc/setup_tick(resumed = FALSE)
|
||||||
if(!setup_choose_gamemode())
|
if(!setup_choose_gamemode())
|
||||||
// It failed, go back to lobby state and re-send the welcome message
|
// It failed, go back to lobby state and re-send the welcome message
|
||||||
pregame_timeleft = config.pregame_time
|
pregame_timeleft = config.pregame_time
|
||||||
|
SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
|
||||||
current_state = GAME_STATE_PREGAME
|
current_state = GAME_STATE_PREGAME
|
||||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||||
pregame_welcome()
|
pregame_welcome()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ SUBSYSTEM_DEF(vote)
|
|||||||
var/duration
|
var/duration
|
||||||
var/mode
|
var/mode
|
||||||
var/question
|
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/choices = list()
|
||||||
var/list/gamemode_names = list()
|
var/list/gamemode_names = list()
|
||||||
var/list/voted = 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)
|
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3)
|
||||||
|
|
||||||
if(mode == VOTE_GAMEMODE && round_progressing)
|
if(mode == VOTE_GAMEMODE && round_progressing)
|
||||||
|
gamemode_vote_called = TRUE
|
||||||
round_progressing = 0
|
round_progressing = 0
|
||||||
to_world("<font color='red'><b>Round start has been delayed.</b></font>")
|
to_world("<font color='red'><b>Round start has been delayed.</b></font>")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user