Skip to content

Commit

Permalink
Created constant for easier Ball Expansion.
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo committed Jun 21, 2020
1 parent 46f4a4b commit 7244b80
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/constants/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#define ITEM_LUXURY_BALL 11
#define ITEM_PREMIER_BALL 12

#define END_BALLS ITEM_PREMIER_BALL

// Pokemon Items
#define ITEM_POTION 13
#define ITEM_ANTIDOTE 14
Expand Down
2 changes: 1 addition & 1 deletion src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static void HandleInputChooseAction(void)
if (gBattleBufferA[gActiveBattler][1] == B_ACTION_USE_ITEM)
{
// Add item to bag if it is a ball
if (itemId <= ITEM_PREMIER_BALL)
if (itemId <= END_BALLS)
AddBagItem(itemId, 1);
else
return;
Expand Down
2 changes: 1 addition & 1 deletion src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5547,7 +5547,7 @@ static void HandleAction_UseItem(void)
ClearFuryCutterDestinyBondGrudge(gBattlerAttacker);
gLastUsedItem = gBattleBufferB[gBattlerAttacker][1] | (gBattleBufferB[gBattlerAttacker][2] << 8);

if (gLastUsedItem <= ITEM_PREMIER_BALL) // is ball
if (gLastUsedItem <= END_BALLS) // is ball
{
gBattlescriptCurrInstr = gBattlescriptsForBallThrow[gLastUsedItem];
}
Expand Down

0 comments on commit 7244b80

Please sign in to comment.