From: bones_was_here Date: Wed, 23 Nov 2022 15:12:36 +0000 (+1000) Subject: Update the types of some voting related globals and fields X-Git-Tag: xonotic-v0.8.6~179^2~4 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=12ba178c7684f0e12a5a6076839e6133050d3358 Update the types of some voting related globals and fields --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 23656d2f75..4b42b5667e 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -158,7 +158,7 @@ void VoteAccept() { bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote for ^1", vote_called_display, "^2 was accepted\n"); - if ((vote_called == VOTE_MASTER) && vote_caller) vote_caller.vote_master = 1; + if ((vote_called == VOTE_MASTER) && vote_caller) vote_caller.vote_master = true; else localcmd(strcat(vote_called_command, "\n")); if (vote_caller) vote_caller.vote_waittime = 0; // people like your votes, you don't need to wait to vote again diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index d92c6a0656..e7ca0c87e4 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -40,15 +40,15 @@ const float VOTE_MASTER = 2; // global vote information declarations entity vote_caller; // original caller of the current vote string vote_caller_name; // name of the vote caller -float vote_called; // stores status of current vote (See VOTE_*) +int vote_called; // stores status of current vote (See VOTE_*) float vote_endtime; // time when the vote is finished -float vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function) -float vote_reject_count; // same as above, but rejected -float vote_abstain_count; // same as above, but abstained -float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor) -.float vote_master; // flag for if the player has vote master privelages +int vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function) +int vote_reject_count; // same as above, but rejected +int vote_abstain_count; // same as above, but abstained +int vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor) +.bool vote_master; // flag for if the player has vote master privileges .float vote_waittime; // flag for how long the player must wait before they can vote again -.float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*) +.int vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*) string vote_called_command; // command sent by client string vote_called_display; // visual string of command sent by client string vote_parsed_command; // command which is fixed after being parsed