summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2020-07-14 19:56:20 -0400
committerGitHub <noreply@github.com>2020-07-14 19:56:20 -0400
commitc177872c9c66b1e1c06a22c2378bb2f790f663fd (patch)
treecaa3cb60a60d9f0a2b0e6f90f67e2c029a00f6d2
parent617e411aca5db4c8f3a319c1a23ac7a6343e3a87 (diff)
parentb31efcd6e3da8fc303a19d9845ca5e9a7d294747 (diff)
Merge pull request #1080 from AsparagusEduardo/EndBalls
Created constant for easier Ball Expansion.
-rw-r--r--include/constants/items.h2
-rw-r--r--src/battle_controller_player.c2
-rw-r--r--src/battle_main.c2
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];
}