Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MakeConsumableChoice.inc.c
Go to the documentation of this file.
1#include "common.h"
2
3API_CALLABLE(N(BuildItemChoiceList)) {
4 Bytecode* args = script->ptrReadPos;
5 s32* allowedItemList = (s32*)evt_get_variable(script, *args++);
6 s32 i;
7
8 if (allowedItemList != NULL) {
9 for (i = 0; allowedItemList[i] != ITEM_NONE; i++) {
10 N(ItemChoiceList)[i] = allowedItemList[i];
11 }
12 N(ItemChoiceList)[i] = ITEM_NONE;
13 } else {
14 for (i = 0; i < ITEM_NUM_CONSUMABLES; i++) {
15 N(ItemChoiceList)[i] = ITEM_FIRST_CONSUMABLE + i;
16 N(ItemChoiceList)[ITEM_NUM_CONSUMABLES] = ITEM_NONE;
17 }
18 }
19 return ApiStatus_DONE2;
20}
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690