summaryrefslogtreecommitdiff
path: root/src/game/g_local.h
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-02-07 20:37:29 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:15 +0100
commit4e42f2df0f599e0beb5e2a935049fb0670ba3e2b (patch)
treea511d791a129e453dc306949154cb2ab36cffa73 /src/game/g_local.h
parent5092712ab377f401fa0b874a990ab7d3cabd08db (diff)
begin rewriting the voting code to be structured in the representation of votes
with this, at least, the "vote action will restart the map" check can be performed in a non-hacky way
Diffstat (limited to 'src/game/g_local.h')
-rw-r--r--src/game/g_local.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 4b47c896..ea12e342 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -434,6 +434,30 @@ struct gclient_s
};
+typedef enum
+{
+ VC_OTHER,
+ VC_RESTART,
+ VC_MAP,
+ VC_NEXTMAP,
+} voteCons_t;
+
+typedef struct
+{
+ char *map;
+} mapVotePms_t;
+
+typedef union
+{
+ mapVotePms_t map;
+} votePms_t;
+
+typedef struct
+{
+ voteCons_t cons;
+ votePms_t pms;
+} vote_t;
+
typedef struct spawnQueue_s
{
int clients[ MAX_CLIENTS ];
@@ -562,6 +586,7 @@ typedef struct
int warmupModificationCount; // for detecting if g_warmup is changed
// voting state
+ vote_t votes[ NUM_TEAMS ];
int voteThreshold[ NUM_TEAMS ]; // need at least this percent to pass
char voteString[ NUM_TEAMS ][ MAX_STRING_CHARS ];
char voteDisplayString[ NUM_TEAMS ][ MAX_STRING_CHARS ];