diff options
author | NieDżejkob <NieDzejkob@users.noreply.github.com> | 2017-01-07 21:02:43 +0100 |
---|---|---|
committer | YamaArashi <YamaArashi@users.noreply.github.com> | 2017-01-07 12:02:43 -0800 |
commit | 7beba74f45cb7f46885cb32c5d4eed1e69dd17ed (patch) | |
tree | 24993d6e460e969ef71a4eb39c8fba15b16658ef /src | |
parent | cdecaed3c9e495410593bd39df97f155efd7adc5 (diff) |
start decompiling daycare.s (#173)
* First matching daycare_count_pokemon
* Update the code style and tidy up daycare_count_pokemon
Diffstat (limited to 'src')
-rw-r--r-- | src/daycare.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/daycare.c b/src/daycare.c new file mode 100644 index 000000000..23f0305d8 --- /dev/null +++ b/src/daycare.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "pokemon.h" +#include "string_util.h" + +u8 *pokemon_get_nick(struct Pokemon *mon, u8 *dest) +{ + s8 nickname[POKEMON_NAME_LENGTH * 2]; + + GetMonData(mon, MON_DATA_NICKNAME, nickname); + return StringCopy10(dest, nickname); +} + +u8 *pokemon_get_nick_(struct BoxPokemon *mon, u8 *dest) +{ + s8 nickname[POKEMON_NAME_LENGTH * 2]; + + GetBoxMonData(mon, MON_DATA_NICKNAME, nickname); + return StringCopy10(dest, nickname); +} + +u8 daycare_count_pokemon(struct BoxPokemon *daycare_data) +{ + u8 i, count; + count = 0; + + for(i = 0;i <= 1;i++) { + if(GetBoxMonData(daycare_data + i, MON_DATA_SPECIES) != 0) { + count++; + } + } + + return count; +} |