From 3812b0dd8eeb8fdaf7f15adb02178e987e2b24bf Mon Sep 17 00:00:00 2001 From: flowtron Date: Thu, 6 Nov 2008 16:57:32 +0000 Subject: [PATCH] votetimer resets on success and mapreset git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3418 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/src/server.cpp b/source/src/server.cpp index ebaba948..e60687a6 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1690,9 +1690,13 @@ void updatesdesc(const char *newdesc) } } -void resetvotes() +void resetvotes(int result) { - loopv(clients) clients[i]->vote = VOTE_NEUTRAL; + loopv(clients) + { + clients[i]->vote = VOTE_NEUTRAL; + if(result!=VOTE_NO) clients[i]->lastvotecall = 0; // flowtron: successful votes and mapchange reset the timer + } } void forceteam(int client, int team, bool respawn, bool notify = false) @@ -1857,7 +1861,7 @@ void resetmap(const char *newname, int newmode, int newtime, bool notify) interm = 0; laststatus = servmillis-61*1000; lastfillup = servmillis; - resetvotes(); + resetvotes(VOTE_NEUTRAL); resetitems(); loopi(3) clnumspawn[i] = 0; loopi(2) clnumflagspawn[i] = 0; @@ -1972,7 +1976,7 @@ struct voteinfo void end(int result) { - resetvotes(); + resetvotes(result); sendf(-1, 1, "ri2", SV_VOTERESULT, result); if(result == VOTE_YES && action) {