From 3c76d8c48ce2782404084b3268df023269cd0a12 Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 1 Oct 2007 17:13:19 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1320 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 2 +- source/src/protocol.h | 2 +- source/src/renderhud.cpp | 1 - source/src/server.cpp | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 4bf3af31..69d793fe 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -723,7 +723,7 @@ void callvotesuc() void callvoteerr(int e) { if(e < 0 || e >= VOTEE_NUM) return; - char *verr[VOTEE_NUM] = { "voting is currently disabled", "there is already a vote pending", "you have already voted", "vote limit reached for the current game", "you can't vote that often", "this vote is only available in multiplayer" }; + char *verr[VOTEE_NUM] = { "voting is currently disabled", "there is already a vote pending", "you have already voted", "you can't vote that often", "this vote is only available in multiplayer" }; conoutf("\f3could not vote: %s", verr[e]); DELETEP(calledvote); } diff --git a/source/src/protocol.h b/source/src/protocol.h index 4aa2a693..3aaabcc7 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -29,7 +29,7 @@ enum enum { SA_KICK = 0, SA_BAN, SA_REMBANS, SA_MASTERMODE, SA_AUTOTEAM, SA_FORCETEAM, SA_GIVEMASTER, SA_MAP, SA_NUM}; enum { VOTE_NEUTRAL = 0, VOTE_YES, VOTE_NO, VOTE_NUM }; -enum { VOTEE_DISABLED = 0, VOTEE_CUR, VOTEE_MUL, VOTEE_MAX, VOTEE_TLIMIT, VOTEE_DED, VOTEE_NUM }; +enum { VOTEE_DISABLED = 0, VOTEE_CUR, VOTEE_MUL, VOTEE_MAX, VOTEE_DED, VOTEE_NUM }; enum { MM_OPEN, MM_PRIVATE, MM_NUM }; #define DMF 16.0f diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 46b9322b..f9095209 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -363,7 +363,6 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat draw_textf("\f3vote %s", left, top+560, curvote->result == VOTE_YES ? "PASSED" : "FAILED"); break; } - } } if(player1->state==CS_ALIVE) diff --git a/source/src/server.cpp b/source/src/server.cpp index 6e08dd27..46b7a68d 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -185,9 +185,7 @@ struct client // server side version of "dynent" type int clientnum; ENetPeer *peer; string hostname; - //string mapvote; // fixme,ah string name, team; - //int modevote; // fixme,ah int vote; int role; bool isauthed; // for passworded servers @@ -444,6 +442,7 @@ bool isdedicated; ENetHost *serverhost = NULL; void process(ENetPacket *packet, int sender, int chan); +void checkvotes(bool forceend=false); void sendf(int cn, int chan, const char *format, ...) { @@ -689,6 +688,7 @@ void disconnect_client(int n, int reason = -1) if(reason>=0) enet_peer_disconnect(c.peer, reason); zapclient(n); sendf(-1, 1, "rii", SV_CDIS, n); + checkvotes(); } void resetitems() { sents.setsize(0); notgotitems = true; } @@ -1208,7 +1208,7 @@ struct voteinfo static voteinfo *curvote = NULL; -void checkvotes(bool forceend = false) +void checkvotes(bool forceend) { if(!curvote) return; int stats[VOTE_NUM] = {0};