diff --git a/plugins/basevotes.sp b/plugins/basevotes.sp index 4337e13e..c09f16d9 100644 --- a/plugins/basevotes.sp +++ b/plugins/basevotes.sp @@ -235,7 +235,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa { if (action == MenuAction_End) { - VoteMenuClose(); + delete g_hVoteMenu; } else if (action == MenuAction_Display) { @@ -286,7 +286,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa votes = totalVotes - votes; // Reverse the votes to be in relation to the Yes option. } - percent = GetVotePercent(votes, totalVotes); + percent = float(votes) / float(totalVotes); if (g_voteType != VoteType_Question) { @@ -404,16 +404,6 @@ void VoteSelect(Menu menu, int param1, int param2 = 0) } */ -void VoteMenuClose() -{ - delete g_hVoteMenu; -} - -float GetVotePercent(int votes, int totalVotes) -{ - return float(votes) / float(totalVotes); -} - bool TestVoteDelay(int client) { int delay = CheckVoteDelay(); diff --git a/plugins/funvotes.sp b/plugins/funvotes.sp index 4587dfbf..7aaabc95 100644 --- a/plugins/funvotes.sp +++ b/plugins/funvotes.sp @@ -167,7 +167,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa { if (action == MenuAction_End) { - VoteMenuClose(); + delete g_hVoteMenu; } else if (action == MenuAction_Display) { @@ -215,7 +215,7 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa votes = totalVotes - votes; // Reverse the votes to be in relation to the Yes option. } - percent = GetVotePercent(votes, totalVotes); + percent = float(votes) / float(totalVotes); limit = g_Cvar_Limits[g_voteType].FloatValue; @@ -306,16 +306,6 @@ void VoteSelect(Menu menu, int param1, int param2 = 0) } */ -void VoteMenuClose() -{ - delete g_hVoteMenu; -} - -float GetVotePercent(int votes, int totalVotes) -{ - return float(votes) / float(totalVotes); -} - bool TestVoteDelay(int client) { int delay = CheckVoteDelay();