diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-05-21 00:48:56 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-05-24 16:14:46 -0400 |
commit | f578c81cfdfb54e1101c5f5785cb685bd63c3b5a (patch) | |
tree | 379ec542f780452a7fb1599871475e6d992440ef /src | |
parent | 83ddca476069c52e0ea550b335539c0371d164c3 (diff) |
More functions governing npc trainer facing directions
Diffstat (limited to 'src')
-rw-r--r-- | src/field_map_obj.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 61ec26365..e5a50362a 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -1642,3 +1642,47 @@ u8 FieldObjectIsTrainerAndCloseToPlayer(struct MapObject *mapObject) } return 1; } + +u8 sub_805CAAC(s16 a0, s16 a1, s16 a2, s16 a3) +{ + u8 dirn; + if (a2 > a3) + { + dirn = DIR_EAST; + if (a0 < 0) + { + dirn = DIR_WEST; + } + } + else + { + dirn = DIR_SOUTH; + if (a1 < 0) + { + dirn = DIR_NORTH; + } + } + return dirn; +} + +u8 sub_805CADC(s16 a0, s16 a1) +{ + u8 dirn; + dirn = DIR_SOUTH; + if (a1 < 0) + { + dirn = DIR_NORTH; + } + return dirn; +} + +u8 sub_805CAEC(s16 a0, s16 a1) +{ + u8 dirn; + dirn = DIR_EAST; + if (a0 < 0) + { + dirn = DIR_WEST; + } + return dirn; +} |