Skip to content

Commit

Permalink
Pass menu ID in MPROP_PAGE_CALLBACK function (#885)
Browse files Browse the repository at this point in the history
Co-authored-by: shel <2@shelru.ru>
  • Loading branch information
afwn90cj93201nixr2e1re and shel committed Jul 17, 2020
1 parent ff2fc19 commit 2e3c105
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions amxmodx/meta_api.cpp
Expand Up @@ -1145,12 +1145,12 @@ void C_ClientCommand(edict_t *pEntity)
if (item == MENU_BACK)
{
if (pMenu->pageCallback >= 0)
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_BACK));
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_BACK), static_cast<cell>(menu));

pMenu->Display(pPlayer->index, pPlayer->page - 1);
} else if (item == MENU_MORE) {
if (pMenu->pageCallback >= 0)
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_MORE));
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_MORE), static_cast<cell>(menu));

pMenu->Display(pPlayer->index, pPlayer->page + 1);
} else {
Expand Down
2 changes: 1 addition & 1 deletion amxmodx/newmenus.cpp
Expand Up @@ -1083,7 +1083,7 @@ static cell AMX_NATIVE_CALL menu_setprop(AMX *amx, cell *params)
break;
}

int callback = registerSPForwardByName(amx, str, FP_CELL, FP_CELL, FP_DONE);
int callback = registerSPForwardByName(amx, str, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
if (callback < 0)
{
LogError(amx, AMX_ERR_NATIVE, "Function %s not present", str);
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/newmenus.inc
Expand Up @@ -76,7 +76,7 @@

/**
* Function to be called on Back and Next (param1 = string)
* public function(id, status); where status is either MENU_BACK or MENU_MORE
* public function(id, status, menu); where status is either MENU_BACK or MENU_MORE
* Pass NULL_STRING to disable the callback
*/
#define MPROP_PAGE_CALLBACK 11
Expand Down

0 comments on commit 2e3c105

Please sign in to comment.