diff options
author | fl4shk <fl4shk@users.noreply.github.com> | 2016-11-04 21:50:44 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-11-05 10:29:27 -0700 |
commit | bb020226fcf8f06258aaada4b39b61fb0f9f9d93 (patch) | |
tree | f9f1d0a59d9b650550622ed894f275f901fb427a /src/heal_location.c | |
parent | 356e04a104f3ac8db482cfeb511dacfa7bde5e53 (diff) |
heal_location.c and landmark.c
Diffstat (limited to 'src/heal_location.c')
-rw-r--r-- | src/heal_location.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/heal_location.c b/src/heal_location.c new file mode 100644 index 000000000..8975898f3 --- /dev/null +++ b/src/heal_location.c @@ -0,0 +1,59 @@ +#include "global.h" + +extern s8 gHealLocations[]; + + +u32 GetHealLocationIndexByMap(u16 arg_0, u16 arg_1) +{ + u32 i = 0; + + s8 *temp = &(gHealLocations[0]); + + for ( ; i<=0x15; i++) + { + if (temp[0] != arg_0) + { + temp += 8; + } + else if (temp[1] != arg_1) + { + temp += 8; + } + else + { + return i + 1; + } + } + + return 0; +} + +u32 GetHealLocationByMap(u16 arg_0, u16 arg_1) +{ + int temp = GetHealLocationIndexByMap(arg_0, arg_1); + + if (!temp) + { + return 0; + } + else + { + return (u32)(gHealLocations - 8 + (temp << 3)); + } +} + +u32 GetHealLocation(u32 arg_0) +{ + if (arg_0 == 0) + { + return 0; + } + else if (arg_0 > 0x16) + { + return 0; + } + else + { + return (u32)(gHealLocations - 8 + (arg_0 << 3)); + } +} |