diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-07-14 19:56:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 19:56:20 -0400 |
commit | c177872c9c66b1e1c06a22c2378bb2f790f663fd (patch) | |
tree | caa3cb60a60d9f0a2b0e6f90f67e2c029a00f6d2 | |
parent | 617e411aca5db4c8f3a319c1a23ac7a6343e3a87 (diff) | |
parent | b31efcd6e3da8fc303a19d9845ca5e9a7d294747 (diff) |
Merge pull request #1080 from AsparagusEduardo/EndBalls
Created constant for easier Ball Expansion.
-rw-r--r-- | include/constants/items.h | 2 | ||||
-rw-r--r-- | src/battle_controller_player.c | 2 | ||||
-rw-r--r-- | src/battle_main.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/include/constants/items.h b/include/constants/items.h index fafcac8b1..ba4d3c49e 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -17,6 +17,8 @@ #define ITEM_LUXURY_BALL 11 #define ITEM_PREMIER_BALL 12 +#define LAST_BALL ITEM_PREMIER_BALL + // Pokemon Items #define ITEM_POTION 13 #define ITEM_ANTIDOTE 14 diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6dd9cd2f4..b933b4a60 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -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 <= LAST_BALL) AddBagItem(itemId, 1); else return; diff --git a/src/battle_main.c b/src/battle_main.c index dd31e12d5..3a78da695 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -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 <= LAST_BALL) // is ball { gBattlescriptCurrInstr = gBattlescriptsForBallThrow[gLastUsedItem]; } |