Skip to content

Commit

Permalink
Merge pull request #2 from dPexxIAM/master
Browse files Browse the repository at this point in the history
add fix for unranked players being able to rtv/vote, fix extend bug

Thanks <3
  • Loading branch information
qawery-just-sad authored Jun 16, 2020
2 parents 7b7b436 + 97c676c commit 6241db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions addons/sourcemod/scripting/mapchooser.sp
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,16 @@ public void Handler_MapVoteFinished(Menu menu, int num_votes, int num_clients, c

char map2[PLATFORM_MAX_PATH];
char displayName[PLATFORM_MAX_PATH];
// menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], map, sizeof(map), _, displayName, sizeof(displayName));
menu.GetItem(item_info[1][VOTEINFO_ITEM_INDEX], map2, sizeof(map2), _, displayName, sizeof(displayName));
menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], map2, sizeof(map2), _, displayName, sizeof(displayName));
// menu.GetItem(item_info[1][VOTEINFO_ITEM_INDEX], map2, sizeof(map2), _, displayName, sizeof(displayName));

if (StrEqual(map2, VOTE_DONTCHANGE) || StrEqual(map2, VOTE_EXTEND))
item_info[0][VOTEINFO_ITEM_INDEX] = item_info[1][VOTEINFO_ITEM_INDEX];
//if (StrEqual(map2, VOTE_DONTCHANGE) || StrEqual(map2, VOTE_EXTEND))
// item_info[0][VOTEINFO_ITEM_INDEX] = item_info[1][VOTEINFO_ITEM_INDEX];

Handler_VoteFinishedGeneric(menu, num_votes, num_clients, client_info, num_items, item_info);
}


public int Handler_MapVoteMenu(Menu menu, MenuAction action, int param1, int param2)
{
switch (action)
Expand Down Expand Up @@ -1351,7 +1352,7 @@ public bool DisplayVoteToPros(int time, int flags, Menu menu)

if (g_Cvar_RankRequirement != null && GetConVarInt(g_Cvar_RankRequirement) > 0)
{
if (surftimer_GetPlayerRank(i) > GetConVarInt(g_Cvar_RankRequirement))
if (surftimer_GetPlayerRank(i) > GetConVarInt(g_Cvar_RankRequirement) || surftimer_GetPlayerRank(i) == 0)
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/rockthevote.sp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void AttemptRTV(int client)

if (GetConVarInt(g_Cvar_RankRequirement) > 0)
{
if (surftimer_GetPlayerRank(client) > GetConVarInt(g_Cvar_RankRequirement))
if (surftimer_GetPlayerRank(client) > GetConVarInt(g_Cvar_RankRequirement) || surftimer_GetPlayerRank(client) == 0)
{
PrintToChat(client, "[SM] %t", "Rank Requirement", GetConVarInt(g_Cvar_RankRequirement));
return;
Expand Down

0 comments on commit 6241db6

Please sign in to comment.