diff --git a/data/event_scripts.s b/data/event_scripts.s index 33fc318957..8a2703423b 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -41,6 +41,7 @@ #include "constants/moves.h" #include "constants/party_menu.h" #include "constants/pokemon.h" +#include "constants/pokemon_size_record.h" #include "constants/roulette.h" #include "constants/script_menu.h" #include "constants/secret_bases.h" diff --git a/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc b/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc index 52bdf3acee..a8d925767d 100644 --- a/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc +++ b/data/maps/SootopolisCity_LotadAndSeedotHouse/scripts.inc @@ -11,9 +11,9 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_SeedotBrother:: copyvar VAR_RESULT, VAR_0x8004 goto_if_eq VAR_RESULT, PARTY_NOTHING_CHOSEN, SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowSeedot special CompareSeedotSize - goto_if_eq VAR_RESULT, 1, SootopolisCity_LotadAndSeedotHouse_EventScript_NotSeedot - goto_if_eq VAR_RESULT, 2, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallSeedot - goto_if_eq VAR_RESULT, 3, SootopolisCity_LotadAndSeedotHouse_EventScript_BigSeedot + goto_if_eq VAR_RESULT, COMPARE_SIZE_INCORRECT_SPECIES, SootopolisCity_LotadAndSeedotHouse_EventScript_NotSeedot + goto_if_eq VAR_RESULT, COMPARE_SIZE_SMALLER, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallSeedot + goto_if_eq VAR_RESULT, COMPARE_SIZE_LARGER, SootopolisCity_LotadAndSeedotHouse_EventScript_BigSeedot release end @@ -55,9 +55,9 @@ SootopolisCity_LotadAndSeedotHouse_EventScript_LotadBrother:: copyvar VAR_RESULT, VAR_0x8004 goto_if_eq VAR_RESULT, PARTY_NOTHING_CHOSEN, SootopolisCity_LotadAndSeedotHouse_EventScript_CancelShowLotad special CompareLotadSize - goto_if_eq VAR_RESULT, 1, SootopolisCity_LotadAndSeedotHouse_EventScript_NotLotad - goto_if_eq VAR_RESULT, 2, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallLotad - goto_if_eq VAR_RESULT, 3, SootopolisCity_LotadAndSeedotHouse_EventScript_BigLotad + goto_if_eq VAR_RESULT, COMPARE_SIZE_INCORRECT_SPECIES, SootopolisCity_LotadAndSeedotHouse_EventScript_NotLotad + goto_if_eq VAR_RESULT, COMPARE_SIZE_SMALLER, SootopolisCity_LotadAndSeedotHouse_EventScript_SmallLotad + goto_if_eq VAR_RESULT, COMPARE_SIZE_LARGER, SootopolisCity_LotadAndSeedotHouse_EventScript_BigLotad release end diff --git a/include/constants/pokemon_size_record.h b/include/constants/pokemon_size_record.h new file mode 100644 index 0000000000..d764716fec --- /dev/null +++ b/include/constants/pokemon_size_record.h @@ -0,0 +1,12 @@ +#ifndef GUARD_CONSTANTS_POKEMON_SIZE_RECORD_H +#define GUARD_CONSTANTS_POKEMON_SIZE_RECORD_H + +enum +{ + COMPARE_SIZE_NONE, + COMPARE_SIZE_INCORRECT_SPECIES, + COMPARE_SIZE_SMALLER, + COMPARE_SIZE_LARGER, +}; + +#endif // GUARD_CONSTANTS_POKEMON_SIZE_RECORD_H diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 7c88e5bf10..71890b526d 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -6,6 +6,7 @@ #include "pokemon_size_record.h" #include "string_util.h" #include "text.h" +#include "constants/pokemon_size_record.h" #define DEFAULT_MAX_SIZE 0x8000 // was 0x8100 in Ruby/Sapphire @@ -109,7 +110,7 @@ static u8 CompareMonSize(u16 species, u16 *sizeRecord) { if (gSpecialVar_Result == 0xFF) { - return 0; + return COMPARE_SIZE_NONE; } else { @@ -117,7 +118,7 @@ static u8 CompareMonSize(u16 species, u16 *sizeRecord) if (GetMonData(pkmn, MON_DATA_IS_EGG) == TRUE || GetMonData(pkmn, MON_DATA_SPECIES) != species) { - return 1; + return COMPARE_SIZE_INCORRECT_SPECIES; } else { @@ -131,12 +132,12 @@ static u8 CompareMonSize(u16 species, u16 *sizeRecord) FormatMonSizeRecord(gStringVar2, newSize); if (newSize <= oldSize) { - return 2; + return COMPARE_SIZE_SMALLER; } else { *sizeRecord = sizeParams; - return 3; + return COMPARE_SIZE_LARGER; } } }