diff options
author | camthesaxman <cameronghall@cox.net> | 2017-09-09 22:04:01 -0500 |
---|---|---|
committer | camthesaxman <cameronghall@cox.net> | 2017-09-09 22:04:01 -0500 |
commit | 5e9e52e3a95f4d7301565ad86084907f2d8a94e6 (patch) | |
tree | f7fe33335554ba2084b7429091e0793bb668ec20 /src/script_pokemon_util_80C4BF0.c | |
parent | 7309b13cb34400e0256c09fd54664a3f918b4e3d (diff) |
more renaming/refactoring
Diffstat (limited to 'src/script_pokemon_util_80C4BF0.c')
-rw-r--r-- | src/script_pokemon_util_80C4BF0.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index cbca07011..6a60a5402 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -542,41 +542,39 @@ void HealPlayerParty(void) } } -u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5) +u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 unused3) { - u16 nationalSpecies; + u16 nationalDexNum; int sentToPc; - u8 array[2]; + u8 heldItem[2]; struct Pokemon mon; - CreateMon(&mon, species, var, 32, 0, 0, 0, 0); - array[0] = item; - array[1] = item >> 8; - SetMonData(&mon, MON_DATA_HELD_ITEM, array); + CreateMon(&mon, species, level, 32, 0, 0, 0, 0); + heldItem[0] = item; + heldItem[1] = item >> 8; + SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); sentToPc = GiveMonToPlayer(&mon); - nationalSpecies = SpeciesToNationalPokedexNum(species); + nationalDexNum = SpeciesToNationalPokedexNum(species); - // nested if check to fool compiler switch(sentToPc) { - case 0: - case 1: - GetNationalPokedexFlag(nationalSpecies, 2); - GetNationalPokedexFlag(nationalSpecies, 3); - return sentToPc; - default: - return sentToPc; + case 0: + case 1: + GetNationalPokedexFlag(nationalDexNum, 2); + GetNationalPokedexFlag(nationalDexNum, 3); + break; } + return sentToPc; } -u8 ScriptGiveEgg(u16 value) +u8 ScriptGiveEgg(u16 species) { struct Pokemon mon; - u8 data; + u8 isEgg; - sub_8042044(&mon, value, 1); - data = 1; - SetMonData(&mon, MON_DATA_IS_EGG, &data); + sub_8042044(&mon, species, 1); + isEgg = TRUE; + SetMonData(&mon, MON_DATA_IS_EGG, &isEgg); return GiveMonToPlayer(&mon); } |