From e8cba3ee0561c12e518a6496caf09848f58e23b0 Mon Sep 17 00:00:00 2001 From: esteel Date: Fri, 5 Sep 2008 17:34:49 +0000 Subject: [PATCH] renamed g_tourney_warmup_unlimited_time to g_tourney_warmup_limit and default it to 60 (-1 is totally unlimited, 0 is up to timelimit, other values limit it further) being limited to 60 seconds, next step is to enable g_tourney too by default (i think CSQC needs to show this in a good way first, we try this later) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4357 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/defaultNexuiz.cfg | 2 +- data/qcsrc/server/clientcommands.qc | 6 ++++-- data/qcsrc/server/defs.qh | 1 + data/qcsrc/server/g_world.qc | 2 +- data/qcsrc/server/miscfunctions.qc | 1 + data/qcsrc/server/sv_main.qc | 9 +++++++++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/data/defaultNexuiz.cfg b/data/defaultNexuiz.cfg index 9527b3655..f2434d598 100644 --- a/data/defaultNexuiz.cfg +++ b/data/defaultNexuiz.cfg @@ -138,7 +138,7 @@ set g_maxplayers_spectator_blocktime 5 //if the players voted for the "nospectat //tournament mod set g_tourney 0 //enables tourney mode which splits the game into a warmup- and match-stage -set g_tourney_warmup_unlimited_time 1 //if set the warmup-stage is not affected by any timelimit, otherwise the usual timelimit also affects warmup-stage +set g_tourney_warmup_limit 60 //if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage, otherwise warmup will be limited to this time (useful for public matches) set g_tourney_warmup_allow_timeout 0 //if set to 0 you cannot use the calltimeout command during the warmup-stage but only during the match stage set g_tourney_disable_spec_chat 1 //if set the chat sent by spectators or observers while being in match-stage can only seen by other specs/observers set g_tourney_disable_spec_vote 1 //if set only players can call a vote during the match-stage (thus spectators and observers can't call a vote then) diff --git a/data/qcsrc/server/clientcommands.qc b/data/qcsrc/server/clientcommands.qc index a1d3e3634..47710e00a 100644 --- a/data/qcsrc/server/clientcommands.qc +++ b/data/qcsrc/server/clientcommands.qc @@ -265,7 +265,8 @@ void SV_ParseClientCommand(string s) { } else if(argv(0) == "ready") { if not(self.flags & FL_CLIENT) return; - if(cvar("sv_ready_restart")) + if((g_tourney && 0 < g_tourney_warmup_limit) // with unlimited warmup players have to be able to restart + || cvar("sv_ready_restart")) { if(timeoutStatus) { return sprint(self, "^1You cannot reset the game while a timeout is active!\n"); @@ -401,6 +402,7 @@ void ReadyRestart() if(g_tourney) { tourneyInMatchStage = 1; //once the game is restarted the game is in match stage //reset weapons and ammo, health and armor to default: + // TODO is this really the right way?!? see miscfunction.qc readlevelcvars() start_weapons = WEPBIT_LASER | WEPBIT_SHOTGUN; start_switchweapon = WEP_SHOTGUN; start_ammo_shells = cvar("g_start_ammo_shells"); @@ -417,7 +419,7 @@ void ReadyRestart() { e.ready = 0; } - if(0= g_tourney_warmup_limit) + { + ReadyRestart(); + return; + } + CreatureFrame (); CheckRules_World (); -- 2.39.2