Skip to content

Commit

Permalink
Merge pull request #225 from powerlord/votecallback-fix
Browse files Browse the repository at this point in the history
Add new-style API compatibility for VoteHandler.
  • Loading branch information
dvander committed Dec 16, 2014
2 parents e250eb6 + 844fad2 commit 58194c5
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions plugins/include/menus.inc
Original file line number Diff line number Diff line change
Expand Up @@ -810,14 +810,28 @@ stock bool VoteMenuToAll(Handle menu, int time, int flags=0)
* @param item_info Array of items, sorted by count. Use VOTEINFO_ITEM
* defines.
*/
typedef VoteHandler = function void (
Menu menu,
int num_votes,
int num_clients,
const int client_info[][2],
int num_items,
const int item_info[][2]
);
typeset VoteHandler
{
// old style
function void(
Menu menu,
int num_votes,
int num_clients,
const int client_info[][2],
int num_items,
const int item_info[][2]
);

// new style
function void(
Menu menu,
int num_votes,
int num_clients,
const int[][] client_info,
int num_items,
const int[][] item_info
);
};

/**
* Sets an advanced vote handling callback. If this callback is set,
Expand Down

0 comments on commit 58194c5

Please sign in to comment.