diff options
Diffstat (limited to 'arm9/src')
-rw-r--r-- | arm9/src/error_handling.c | 16 | ||||
-rw-r--r-- | arm9/src/pokemon.c | 19 |
2 files changed, 26 insertions, 9 deletions
diff --git a/arm9/src/error_handling.c b/arm9/src/error_handling.c new file mode 100644 index 00000000..9052773f --- /dev/null +++ b/arm9/src/error_handling.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "error_handling.h" + +extern u32 FUN_02031810(void); +extern void PrintErrorMessageAndReset(void); + +THUMB_FUNC void ErrorHandling(void) +{ + if (FUN_02031810()) + { + if (OS_GetProcMode() != OS_PROCMODE_IRQ) + { + PrintErrorMessageAndReset(); + } + } +} diff --git a/arm9/src/pokemon.c b/arm9/src/pokemon.c index fb1ad894..48b1a225 100644 --- a/arm9/src/pokemon.c +++ b/arm9/src/pokemon.c @@ -17,6 +17,7 @@ #include "constants/items.h" #include "constants/moves.h" #include "constants/sinnoh_dex.h" +#include "constants/trainer_classes.h" #pragma thumb on @@ -3701,21 +3702,21 @@ int FUN_0206AA30(int x) { switch (x) { - case 63: + case TRAINER_CLASS_PKMN_TRAINER_BARRY: return 2; - case 90: - case 91: - case 92: - case 93: - case 94: - return x - 87; + case TRAINER_CLASS_PKMN_TRAINER_AROMA_LADY: + case TRAINER_CLASS_PKMN_TRAINER_RICH_BOY: + case TRAINER_CLASS_PKMN_TRAINER_PICNICKER: + case TRAINER_CLASS_PKMN_TRAINER_CAMPER: + case TRAINER_CLASS_PKMN_TRAINER_POKEKID: + return x - TRAINER_CLASS_COMMANDER_JUPITER; default: if (FUN_0206AE00(x) == 1) return 1; else return 0; - case 0: - case 1: + case TRAINER_CLASS_PKMN_TRAINER_M: + case TRAINER_CLASS_PKMN_TRAINER_F: return x; } } |