Skip to content

Commit

Permalink
broadcast votes
Browse files Browse the repository at this point in the history
during intermission, bprint 'player voted for map foo..' per vote.
  • Loading branch information
sputnikutah committed Jul 9, 2024
1 parent 1b89b2d commit 38bee9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/client.qc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void() IntermissionThink =

if ((self.warp_map) && ((self.warp_map) == self.impulse))
{
bprint(sprintf("%s \bREMOVED\b their vote for %s.\n",self.netname, vote_map_choices[self.warp_map]));
map_choices[self.warp_map] -= 1;
self.warp_map = 0;
self.impulse = 0;
Expand All @@ -332,15 +333,18 @@ void() IntermissionThink =
return;
}

if (self.warp_map)
if ((self.warp_map) && ((self.warp_map) != self.impulse))
{
bprint(sprintf("%s changed their vote...\[-1 %s \]\n",self.netname, vote_map_choices[self.warp_map]));
map_choices[self.warp_map] -= 1;
self.warp_map = 0;
centerprint(self, VOTE_MENU_TEXTLINE[0], VOTE_MENU_TEXTLINE[1], VOTE_MENU_TEXTLINE[2], VOTE_MENU_TEXTLINE[3], VOTE_MENU_TEXTLINE[4], VOTE_MENU_TEXTLINE[5], VOTE_MENU_TEXTLINE[6]);
}

self.warp_map = self.impulse;
map_choices[self.warp_map] += 1;
bprint(sprintf("%s voted for %s.\n",self.netname, vote_map_choices[self.warp_map]));


// if (clanring_gameconfig & CLANRING_VOTE_MAJORITY_PASS)
{
Expand Down
2 changes: 1 addition & 1 deletion src/server.qc
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void () clanring_init_world =

//CRMOD - string to be used throughout code to show version number.
//version.year.month.day
string vstring = "24.07.04";
string vstring = "24.07";

clanring_version = strzone(sprintf("\bClanRing\b\nCRx (v1.%s)",vstring)); // This is used in the server console, the help display, and on connect.
clanring_version_info = strzone(sprintf("CRx (v1.%s)",vstring)); // This is the value for the forced server infokey named "mod".
Expand Down
12 changes: 6 additions & 6 deletions src/votemenu.qc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ string (float n) VoteMenu_get_map_by_number =
{
if ((n != 0) && ((strlen(warpmap[n].name) != 0)) && (n <= (WARP_CATEGORY_SIZE * WARP_MAPLIST_SIZE)))
{
return (sprintf("%s %s",warpmap[n].name, substring(warpmap[n].title, 0, 20)));
return (sprintf("%s %s",substring(warpmap[n].name, 0, 16), substring(warpmap[n].title, 0, 16)));
}
return (sprintf("%s %s",warpmap[n - 5].name, warpmap[n - 5].title));//go back a few if we are at the end...
};
Expand Down Expand Up @@ -93,19 +93,19 @@ void () VoteMenu_Init =
VOTE_MENU_TEXTLINE[5] = " \5 A\n\n";
VOTE_MENU_TEXTLINE[6] = "\n\n";

VOTE_MENU_TEXTLINE[1] = strreplace("A", (strpad(36, nextmap_textline1)), VOTE_MENU_TEXTLINE[1]);
VOTE_MENU_TEXTLINE[1] = strreplace("A", (strpad(34, nextmap_textline1)), VOTE_MENU_TEXTLINE[1]);
VOTE_MENU_TEXTLINE[7] = redify(VOTE_MENU_TEXTLINE[1]);

VOTE_MENU_TEXTLINE[2] = strreplace("A", (strpad(36, nextmap_textline2)), VOTE_MENU_TEXTLINE[2]);
VOTE_MENU_TEXTLINE[2] = strreplace("A", (strpad(34, nextmap_textline2)), VOTE_MENU_TEXTLINE[2]);
VOTE_MENU_TEXTLINE[8] = redify(VOTE_MENU_TEXTLINE[2]);

VOTE_MENU_TEXTLINE[3] = strreplace("A", (strpad(36, nextmap_textline3)), VOTE_MENU_TEXTLINE[3]);
VOTE_MENU_TEXTLINE[3] = strreplace("A", (strpad(34, nextmap_textline3)), VOTE_MENU_TEXTLINE[3]);
VOTE_MENU_TEXTLINE[9] = redify(VOTE_MENU_TEXTLINE[3]);

VOTE_MENU_TEXTLINE[4] = strreplace("A", (strpad(36, nextmap_textline4)), VOTE_MENU_TEXTLINE[4]);
VOTE_MENU_TEXTLINE[4] = strreplace("A", (strpad(34, nextmap_textline4)), VOTE_MENU_TEXTLINE[4]);
VOTE_MENU_TEXTLINE[10] = redify(VOTE_MENU_TEXTLINE[4]);

VOTE_MENU_TEXTLINE[5] = strreplace("A", (strpad(36, nextmap_textline5)), VOTE_MENU_TEXTLINE[5]);
VOTE_MENU_TEXTLINE[5] = strreplace("A", (strpad(34, nextmap_textline5)), VOTE_MENU_TEXTLINE[5]);
VOTE_MENU_TEXTLINE[11] = redify(VOTE_MENU_TEXTLINE[5]);

VOTE_MENU_TEXTLINE[1] = strzone(VOTE_MENU_TEXTLINE[1]);
Expand Down

0 comments on commit 38bee9f

Please sign in to comment.