From 6f71fbe521ebe7ff1d3490ec3851ad28e9284ec0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 17 Sep 2023 17:11:55 -0400 Subject: [PATCH] Add some missing trainer hill constant usage --- src/event_object_movement.c | 4 ++-- src/trainer_hill.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 411b826a53..29dcf4d27c 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1324,7 +1324,7 @@ u8 Unref_TryInitLocalObjectEvent(u8 localId) if (InBattlePyramid()) objectEventCount = GetNumBattlePyramidObjectEvents(); else if (InTrainerHill()) - objectEventCount = 2; + objectEventCount = HILL_TRAINERS_PER_FLOOR; else objectEventCount = gMapHeader.events->objectEventCount; @@ -1640,7 +1640,7 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) if (InBattlePyramid()) objectCount = GetNumBattlePyramidObjectEvents(); else if (InTrainerHill()) - objectCount = 2; + objectCount = HILL_TRAINERS_PER_FLOOR; else objectCount = gMapHeader.events->objectEventCount; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index cca1a3e984..018b9f14ba 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -650,7 +650,7 @@ void LoadTrainerHillObjectEventTemplates(void) eventTemplates[i].localId = i + 1; eventTemplates[i].graphicsId = FacilityClassToGraphicsId(sHillData->floors[floorId].trainers[i].facilityClass); eventTemplates[i].x = sHillData->floors[floorId].map.trainerCoords[i] & 0xF; - eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + 5; + eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + HILL_FLOOR_HEIGHT_MARGIN; bits = i << 2; eventTemplates[i].movementType = ((sHillData->floors[floorId].map.trainerDirections >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].map.trainerRanges >> bits) & 0xF;