diff options
author | huderlem <huderlem@gmail.com> | 2019-02-04 21:36:18 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-04 21:36:18 -0600 |
commit | b0ee1009759ed1c46da81b1fb8410e2b75e42bb2 (patch) | |
tree | ceee3e124b987b8dd24cb3a7bba85d4effe1ef5d /src/trainer_hill.c | |
parent | 646533cfa3c8c42aee3efedaadfe49e495b64892 (diff) | |
parent | d4125fef9bc9adb95c7a5fb5b8be903b34adc510 (diff) |
Merge pull request #543 from pret/mapdata
Convert map data to JSON
Diffstat (limited to 'src/trainer_hill.c')
-rw-r--r-- | src/trainer_hill.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/trainer_hill.c b/src/trainer_hill.c index e0a236286..309ffdb1d 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -24,6 +24,7 @@ #include "constants/event_object_movement_constants.h" #include "constants/event_objects.h" #include "constants/items.h" +#include "constants/layouts.h" #include "constants/moves.h" #include "constants/maps.h" #include "constants/species.h" @@ -324,7 +325,7 @@ void ResetTrainerHillResults(void) static u8 GetFloorId(void) { - return gMapHeader.mapLayoutId - 159; + return gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; } u8 GetTrainerHillOpponentClass(u16 trainerId) @@ -385,7 +386,7 @@ static void SetUpDataStruct(void) if (sHillData == NULL) { sHillData = AllocZeroed(sizeof(*sHillData)); - sHillData->floorId = gMapHeader.mapLayoutId - 159; + sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag)); nullsub_2(); } @@ -803,10 +804,10 @@ bool32 InTrainerHill(void) { bool32 ret; - if (gMapHeader.mapLayoutId == 0x19F - || gMapHeader.mapLayoutId == 0x1A0 - || gMapHeader.mapLayoutId == 0x1A1 - || gMapHeader.mapLayoutId == 0x1A2) + if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_1F + || gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_2F + || gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_3F + || gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_4F) ret = TRUE; else ret = FALSE; @@ -818,17 +819,17 @@ u8 GetCurrentTrainerHillMapId(void) { u8 ret; - if (gMapHeader.mapLayoutId == 0x19F) + if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_1F) ret = 1; - else if (gMapHeader.mapLayoutId == 0x1A0) + else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_2F) ret = 2; - else if (gMapHeader.mapLayoutId == 0x1A1) + else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_3F) ret = 3; - else if (gMapHeader.mapLayoutId == 0x1A2) + else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_4F) ret = 4; - else if (gMapHeader.mapLayoutId == 0x1A3) + else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ROOF) ret = 5; - else if (gMapHeader.mapLayoutId == 0x19E) + else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ENTRANCE) ret = 6; else ret = 0; @@ -840,7 +841,7 @@ static bool32 sub_81D6100(void) { bool32 ret; - if (gMapHeader.mapLayoutId == 0x1A3) + if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ROOF) ret = TRUE; else ret = FALSE; |