From 26f37ff0ee5f28c92788ba981d575c2010108579 Mon Sep 17 00:00:00 2001 From: esteel Date: Thu, 19 Feb 2009 17:24:04 +0000 Subject: [PATCH] unready feature.. needs more testing though git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5895 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/defaultNexuiz.cfg | 1 + data/qcsrc/server/clientcommands.qc | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/data/defaultNexuiz.cfg b/data/defaultNexuiz.cfg index d03774d6c..2adf86633 100644 --- a/data/defaultNexuiz.cfg +++ b/data/defaultNexuiz.cfg @@ -54,6 +54,7 @@ alias asay_drop "say_team (%l) dropped %w ; impulse 17" alias +hook +button6 alias -hook -button6 alias ready "cmd ready" +alias unready "cmd unready" alias lockteams "sv_cmd lockteams" alias unlockteams "sv_cmd unlockteams" alias nospectators "sv_cmd nospectators" diff --git a/data/qcsrc/server/clientcommands.qc b/data/qcsrc/server/clientcommands.qc index 99db83bb9..e82b9febe 100644 --- a/data/qcsrc/server/clientcommands.qc +++ b/data/qcsrc/server/clientcommands.qc @@ -224,25 +224,31 @@ void SV_ParseClientCommand(string s) { } else { sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) ); } - } else if(argv(0) == "ready") { + } else if((argv(0) == "ready") || (argv(0) == "unready")) { if not(self.flags & FL_CLIENT) return; + if((inWarmupStage && 0 <= g_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"); - } - + if(!readyrestart_happened || cvar("sv_ready_restart_repeatable")) { - if(!readyrestart_happened || cvar("sv_ready_restart_repeatable")) + if (argv(0) == "ready") { self.ready = TRUE; bprint(self.netname, "^2 is ready\n"); - ReadyCount(); - } else { - sprint(self, "^1game has already been restarted\n"); } + else + { + self.ready = FALSE; + bprint(self.netname, "^2 is ^1NOT^2 ready\n"); + } + + // cannot reset the game while a timeout is active! + if(!timeoutStatus) { + ReadyCount(); + } else { + sprint(self, "^1Game has already been restarted\n"); } } } else if(argv(0) == "maplist") { -- 2.39.2