source-sdk-2013
source-sdk-2013 copied to clipboard
[TF2] Readymode countdown logic fixes
Description
Various minor fixes for the readymode countdown timer.
- Fix the game skipping to the final countdown 1s early.
- Issue is caused by
(int)(flTime - gpGlobals->curtime)truncating the decimal part of the countdown. Addingceilpermits the number 11 back in to the lands.
- Issue is caused by
- Reset the game ready state if a disconnecting player would cause the game to fall under the minimum player count required to start.
- This is a cosmetic change as it isn't possible for the game to begin in this state anyway, but the countdown still continues uninterruptibly to scare the remaining players.
- Fix the countdown continuing when the only readied-up player in MvM disconnects.
- There's already a check for this in tournament readymode, but an equivalent check was not present for MvM.
- Respect
mp_tournament_readymode_countdownin MvM.- This is hardcoded to 10s, but there isn't really any harm in allowing this CVar to be used instead as it also defaults to 10s.