diff --git a/source/src/client.cpp b/source/src/client.cpp index 915d5e8c..d2825bda 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -150,6 +150,7 @@ void disconnect(int onlyclean, int async) player1->clientrole = CR_DEFAULT; if(m_botmode) BotManager.EndMap(); loopv(players) zapplayer(players[i]); + clearvote(); localdisconnect(); } if(!connpeer && clienthost) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 69d793fe..72ab0dca 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -739,6 +739,8 @@ void voteresult(int v) } } +void clearvote() { DELETEP(curvote); DELETEP(calledvote); } + COMMAND(callvote, ARG_3STR); COMMAND(vote, ARG_1INT); diff --git a/source/src/protos.h b/source/src/protos.h index 3bba6f5b..b2cf4119 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -171,12 +171,13 @@ struct votedisplayinfo votedisplayinfo() : owner(NULL), result(VOTE_NEUTRAL), millis(0), localplayervoted(false) { loopi(VOTE_NUM) stats[i] = VOTE_NEUTRAL; } }; +extern votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char *arg2); extern void callvotesuc(); extern void callvoteerr(int e); extern void displayvote(votedisplayinfo *v); extern void voteresult(int v); extern void votecount(int v); -extern votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char *arg2); +extern void clearvote(); // scoreboard extern void showscores(bool on); diff --git a/source/src/server.cpp b/source/src/server.cpp index a612ac0b..592c08cc 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1860,6 +1860,8 @@ void serverslice(uint timeout) // main server update, called from cube main lo if(m_arena) arenacheck(); } + lastsec = seconds; + if(curvote && !curvote->isalive()) checkvotes(true); int nonlocalclients = numnonlocalclients();