From 36e7b68bd7a7db03b0450c1a4a611bce4e5a7744 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 2 Jan 2013 10:48:47 +0100 Subject: [PATCH] Small cleanup, get rid of a redundant check, an unused variable and an outdated comment --- qcsrc/server/command/vote.qc | 48 ++++++++++------------- qcsrc/server/mutators/gamemode_arena.qh | 1 - qcsrc/server/mutators/gamemode_keyhunt.qh | 1 - 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index f6f99d01b..0506ade2c 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -319,9 +319,7 @@ void VoteThink() // Game logic for warmup // ======================= -/** - * Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map. - */ +// Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map. void reset_map(float dorespawn) { entity oldself; @@ -368,31 +366,27 @@ void reset_map(float dorespawn) // on spawnpoint entities which have to be reset first --blub if(dorespawn) if(!MUTATOR_CALLHOOK(reset_map_players)) - FOR_EACH_CLIENT(self) { - if(self.flags & FL_CLIENT) // reset all players + FOR_EACH_CLIENT(self) // reset all players + { + /* + only reset players if a restart countdown is active + this can either be due to cvar sv_ready_restart_after_countdown having set + restart_mapalreadyrestarted to 1 after the countdown ended or when + sv_ready_restart_after_countdown is not used and countdown is still running + */ + if (restart_mapalreadyrestarted || (time < game_starttime)) { - { - /* - only reset players if a restart countdown is active - this can either be due to cvar sv_ready_restart_after_countdown having set - restart_mapalreadyrestarted to 1 after the countdown ended or when - sv_ready_restart_after_countdown is not used and countdown is still running - */ - if (restart_mapalreadyrestarted || (time < game_starttime)) - { - //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players - if (self.classname == "player") { - //PlayerScore_Clear(self); - if(g_lms) - PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()); - self.killcount = 0; - //stop the player from moving so that he stands still once he gets respawned - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - self.movement = '0 0 0'; - PutClientInServer(); - } - } + //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players + if (self.classname == "player") { + //PlayerScore_Clear(self); + if(g_lms) + PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()); + self.killcount = 0; + //stop the player from moving so that he stands still once he gets respawned + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + self.movement = '0 0 0'; + PutClientInServer(); } } } diff --git a/qcsrc/server/mutators/gamemode_arena.qh b/qcsrc/server/mutators/gamemode_arena.qh index 2c455dbdd..7e23d4f1c 100644 --- a/qcsrc/server/mutators/gamemode_arena.qh +++ b/qcsrc/server/mutators/gamemode_arena.qh @@ -1,7 +1,6 @@ float maxspawned; float numspawned; float arena_roundbased; -float arena_roundbased_state; .float spawned; .entity spawnqueue_next; .entity spawnqueue_prev; diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qh b/qcsrc/server/mutators/gamemode_keyhunt.qh index 8ee843429..55614ff8e 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qh +++ b/qcsrc/server/mutators/gamemode_keyhunt.qh @@ -6,7 +6,6 @@ float kh_tracking_enabled; .entity kh_next; float kh_Key_AllOwnedByWhichTeam(); -// used by arena.qc ready-restart: typedef void(void) kh_Think_t; void kh_StartRound(); void kh_Controller_SetThink_NoMsg(float t, kh_Think_t func); -- 2.39.2