Prevent enum shadowing & pin sourcemod for build fixes (#1661)

This commit is contained in:
Headline 2021-12-10 14:22:04 -08:00 committed by GitHub
parent af3c10b173
commit e786ff54f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 17 deletions

View File

@ -60,15 +60,15 @@ ConVar g_Cvar_Limits[3] = {null, ...};
ConVar g_Cvar_Voteban = null; ConVar g_Cvar_Voteban = null;
//ConVar g_Cvar_VoteSay = null; //ConVar g_Cvar_VoteSay = null;
enum voteType enum VoteType
{ {
map, VoteType_Map,
kick, VoteType_Kick,
ban, VoteType_Ban,
question VoteType_Question
} }
voteType g_voteType = question; VoteType g_voteType = VoteType_Question;
// Menu API does not provide us with a way to pass multiple peices of data with a single // Menu API does not provide us with a way to pass multiple peices of data with a single
// choice, so some globals are used to hold stuff. // choice, so some globals are used to hold stuff.
@ -202,7 +202,7 @@ public Action Command_Vote(int client, int args)
len += pos; len += pos;
} }
} }
g_voteType = question; g_voteType = VoteType_Question;
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL); g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
g_hVoteMenu.SetTitle("%s?", g_voteArg); g_hVoteMenu.SetTitle("%s?", g_voteArg);
@ -239,7 +239,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
} }
else if (action == MenuAction_Display) else if (action == MenuAction_Display)
{ {
if (g_voteType != question) if (g_voteType != VoteType_Question)
{ {
char title[64]; char title[64];
menu.GetTitle(title, sizeof(title)); menu.GetTitle(title, sizeof(title));
@ -288,7 +288,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
percent = GetVotePercent(votes, totalVotes); percent = GetVotePercent(votes, totalVotes);
if (g_voteType != question) if (g_voteType != VoteType_Question)
{ {
limit = g_Cvar_Limits[g_voteType].FloatValue; limit = g_Cvar_Limits[g_voteType].FloatValue;
} }
@ -307,7 +307,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
switch (g_voteType) switch (g_voteType)
{ {
case (question): case VoteType_Question:
{ {
if (strcmp(item, VOTE_NO) == 0 || strcmp(item, VOTE_YES) == 0) if (strcmp(item, VOTE_NO) == 0 || strcmp(item, VOTE_YES) == 0)
{ {
@ -317,7 +317,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
PrintToChatAll("[SM] %t", "Vote End", g_voteArg, item); PrintToChatAll("[SM] %t", "Vote End", g_voteArg, item);
} }
case (map): case VoteType_Map:
{ {
// single-vote items don't use the display item // single-vote items don't use the display item
char displayName[PLATFORM_MAX_PATH]; char displayName[PLATFORM_MAX_PATH];
@ -329,7 +329,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
dp.WriteString(item); dp.WriteString(item);
} }
case (kick): case VoteType_Kick:
{ {
int voteTarget; int voteTarget;
if((voteTarget = GetClientOfUserId(g_voteTarget)) == 0) if((voteTarget = GetClientOfUserId(g_voteTarget)) == 0)
@ -350,7 +350,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
} }
} }
case (ban): case VoteType_Ban:
{ {
if (g_voteArg[0] == '\0') if (g_voteArg[0] == '\0')
{ {

View File

@ -42,7 +42,7 @@ void DisplayVoteBanMenu(int client, int target)
LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target); LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]); ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]);
g_voteType = ban; g_voteType = VoteType_Ban;
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL); g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
g_hVoteMenu.SetTitle("Voteban Player"); g_hVoteMenu.SetTitle("Voteban Player");

View File

@ -40,7 +40,7 @@ void DisplayVoteKickMenu(int client, int target)
LogAction(client, target, "\"%L\" initiated a kick vote against \"%L\"", client, target); LogAction(client, target, "\"%L\" initiated a kick vote against \"%L\"", client, target);
ShowActivity(client, "%t", "Initiated Vote Kick", g_voteInfo[VOTE_NAME]); ShowActivity(client, "%t", "Initiated Vote Kick", g_voteInfo[VOTE_NAME]);
g_voteType = kick; g_voteType = VoteType_Kick;
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL); g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
g_hVoteMenu.SetTitle("Votekick Player"); g_hVoteMenu.SetTitle("Votekick Player");

View File

@ -51,7 +51,7 @@ void DisplayVoteMapMenu(int client, int mapCount, char[][] maps)
LogAction(client, -1, "\"%L\" initiated a map vote for%s.", client, maps_list); LogAction(client, -1, "\"%L\" initiated a map vote for%s.", client, maps_list);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map"); ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map");
g_voteType = map; g_voteType = VoteType_Map;
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL); g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);

@ -1 +1 @@
Subproject commit 7cb5bede74c184b9b1de4dbf6b0bfc2d23c4a17e Subproject commit 5b1ad5059f7ddc7fc46065531b5b22a67c79f814