summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkiliwily <69381603+kiliwily@users.noreply.github.com>2020-08-29 01:02:20 +0200
committerkiliwily <69381603+kiliwily@users.noreply.github.com>2020-08-29 01:02:20 +0200
commitc68c2b66e8a9e4d1b6fd79c6b3403970f07b376a (patch)
treec95d872398ef248839d3c775b76ed307632d9d80
parent5e7b6a089ce765c4033934cce20dfe8960aca9ad (diff)
add more macros
-rw-r--r--include/constants/daycare.h2
-rw-r--r--src/move_relearner.c24
2 files changed, 14 insertions, 12 deletions
diff --git a/include/constants/daycare.h b/include/constants/daycare.h
index 103f920f2..adb62fab5 100644
--- a/include/constants/daycare.h
+++ b/include/constants/daycare.h
@@ -22,6 +22,6 @@
// Array buffers
#define EGG_MOVES_ARRAY_COUNT 10
-#define EGG_LVL_UP_MOVES_ARRAY_COUNT 50
+#define EGG_LVL_UP_MOVES_ARRAY_COUNT (MAX_LEVEL_UP_MOVES > 50 ? MAX_LEVEL_UP_MOVES : 50)
#endif //GUARD_DAYCARE_CONSTANTS_H
diff --git a/src/move_relearner.c b/src/move_relearner.c
index 1c863804b..3741d5973 100644
--- a/src/move_relearner.c
+++ b/src/move_relearner.c
@@ -150,20 +150,22 @@
#define JAM_HEART_EMPTY 2
#define JAM_HEART_FULL 3
+#define MAX_RELEARNER_MOVES (MAX_LEVEL_UP_MOVES > 25 ? MAX_LEVEL_UP_MOVES : 25)
+
static EWRAM_DATA struct
{
u8 state;
- u8 heartSpriteIds[16]; /*0x001*/
- u16 movesToLearn[25]; /*0x01A*/
- u8 partyMon; /*0x044*/
- u8 moveSlot; /*0x045*/
- struct ListMenuItem menuItems[25]; /*0x0E8*/
- u8 numMenuChoices; /*0x110*/
- u8 numToShowAtOnce; /*0x111*/
- u8 moveListMenuTask; /*0x112*/
- u8 moveListScrollArrowTask; /*0x113*/
- u8 moveDisplayArrowTask; /*0x114*/
- u16 scrollOffset; /*0x116*/
+ u8 heartSpriteIds[16]; /*0x001*/
+ u16 movesToLearn[MAX_RELEARNER_MOVES]; /*0x01A*/
+ u8 partyMon; /*0x044*/
+ u8 moveSlot; /*0x045*/
+ struct ListMenuItem menuItems[MAX_RELEARNER_MOVES]; /*0x0E8*/
+ u8 numMenuChoices; /*0x110*/
+ u8 numToShowAtOnce; /*0x111*/
+ u8 moveListMenuTask; /*0x112*/
+ u8 moveListScrollArrowTask; /*0x113*/
+ u8 moveDisplayArrowTask; /*0x114*/
+ u16 scrollOffset; /*0x116*/
} *sMoveRelearnerStruct = {0};
static EWRAM_DATA struct {