X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fvote.qc;h=61fd2f3a2d44d423b8a2a1792aec5f635a7ae420;hb=d54570b726a703243969825c816749ebdfe78d48;hp=b25449b91c725e1e9e110f5e6aef31e832ed1b13;hpb=ed25b097beea2aee6cdec771ebd01a257cf08fc9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index b25449b91..61fd2f3a2 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -28,7 +28,7 @@ // Nagger for players to know status of voting float Nagger_SendEntity(entity to, float sendflags) { - float nags, i, f, b; + int nags, i, f, b; entity e; WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER); @@ -235,7 +235,7 @@ void VoteCount(float first_count) switch(tmp_player.vote_selection) { case VOTE_SELECT_REJECT: { ++vote_reject_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; } - case VOTE_SELECT_ACCEPT: { ++vote_accept_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; } + case VOTE_SELECT_ACCEPT: { ++vote_accept_count; { if(IS_PLAYER(tmp_player)) ++vote_real_accept_count; } break; } case VOTE_SELECT_ABSTAIN: { ++vote_abstain_count; { if(IS_PLAYER(tmp_player)) ++vote_real_abstain_count; } break; } default: break; } @@ -637,7 +637,7 @@ float VoteCommand_checkargs(float startpos, float argc) p = strstrofs(cmdrestriction, ";", 0); // find first semicolon - for(0;;) + for (;;) { // we know that at any time, startpos <= argc - minargs // so this means: argc-minargs >= startpos >= argc, thus @@ -814,6 +814,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); } else if(vote_called) { print_to(caller, "^1There is already a vote called."); } else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); } + else if(caller && !IS_CLIENT(caller)) { print_to(caller, "^1Only connected clients can vote."); } else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); } else if(caller && (time < caller.vote_waittime)) { print_to(caller, strcat("^1You have to wait ^2", ftos(ceil(caller.vote_waittime - time)), "^1 seconds before you can again call a vote.")); } else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }