summaryrefslogtreecommitdiff
path: root/arm9/src
diff options
context:
space:
mode:
authortgsm <doodrabbit@hotmail.com>2021-01-14 18:22:00 -0500
committertgsm <doodrabbit@hotmail.com>2021-01-14 18:22:00 -0500
commita37fd3dff5df3a93ac7d756d1e16d411a0299dc9 (patch)
treefc5a94ad854311d6626f158a8c07c940a5245d95 /arm9/src
parentc3b81b6ec04d0e29b9bb9cf4c9722daa5f40bfa6 (diff)
decompile unk_0202C144
Diffstat (limited to 'arm9/src')
-rw-r--r--arm9/src/unk_0202C144.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arm9/src/unk_0202C144.c b/arm9/src/unk_0202C144.c
new file mode 100644
index 00000000..b7dd45aa
--- /dev/null
+++ b/arm9/src/unk_0202C144.c
@@ -0,0 +1,26 @@
+#include "global.h"
+#include "pokedex.h"
+#include "poketch.h"
+#include "unk_02029FB0.h"
+#include "unk_0202C144.h"
+
+#pragma thumb on
+
+extern struct UnkStruct_02029FB0 * FUN_02029FC8(struct SaveBlock2 * sav2);
+extern void FUN_0202A1C4(struct UnkStruct_02029FB0 * unk, struct Pokedex * pokedex, u16 species);
+
+void FUN_0202C144(struct SaveBlock2 * sav2, struct Pokemon * mon)
+{
+ u32 is_egg = GetMonData(mon, MON_DATA_IS_EGG, NULL);
+ if (!is_egg)
+ {
+ struct Pokedex * pokedex = Sav2_Pokedex_get(sav2);
+ struct UnkStruct_02029FB0 * unk = FUN_02029FC8(sav2);
+ u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ FUN_0202A1C4(unk, pokedex, (u16)species);
+ Pokedex_SetMonCaughtFlag(pokedex, mon);
+
+ struct SavePoketch * poketch = Sav2_Poketch_get(sav2);
+ Sav2_Poketch_PokemonHistoryAddMon(poketch, &mon->box);
+ }
+}