.entity surv_attack_sprite; ///< Holds the sprite telling attackers to attack.
int surv_type; ///< Holds the type of survival. See SURVIVAL_TYPE constants.
+bool surv_warmup; ///< Holds whether warmup is active.
/// \brief Holds the type of the current round. See SURVIVAL_ROUND constants.
int surv_roundtype;
bool surv_isroundactive; ///< Holds whether the round is active.
//============================= Hooks ========================================
+/// \brief Hook that is called to determine general rules of the game.
+MUTATOR_HOOKFUNCTION(surv, ReadLevelCvars)
+{
+ surv_warmup = warmup_stage;
+}
+
/// \brief Hook that is called to determine if there is a weapon arena.
MUTATOR_HOOKFUNCTION(surv, SetWeaponArena)
{
{
LOG_TRACE("Survival: reset_map_global");
surv_allowed_to_spawn = true;
- surv_numattackersalive = 0;
- surv_numdefendersalive = 0;
if (surv_roundtype == SURVIVAL_ROUND_FIRST)
{
FOREACH_CLIENT(IS_REAL_CLIENT(it),
MUTATOR_HOOKFUNCTION(surv, reset_map_players)
{
LOG_TRACE("Survival: reset_map_players");
- if (surv_type == SURVIVAL_TYPE_VERSUS)
+ surv_numattackersalive = 0;
+ surv_numdefendersalive = 0;
+ if (surv_warmup)
+ {
+ surv_warmup = false;
+ }
+ else if (surv_type == SURVIVAL_TYPE_VERSUS)
{
Surv_SwapTeams();
}
it.team = -1;
it.surv_state = SURVIVAL_STATE_PLAYING;
}
- if (it.surv_state != SURVIVAL_STATE_NOT_PLAYING)
+ if (it.surv_state == SURVIVAL_STATE_PLAYING)
{
TRANSMUTE(Player, it);
it.surv_state = SURVIVAL_STATE_PLAYING;