Add some missing trainer hill constant usage

This commit is contained in:
GriffinR 2023-09-17 17:11:55 -04:00
parent dec4b580a3
commit 6f71fbe521
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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;