Bugfix for cable car sprite array count

This commit is contained in:
Scyrous 2024-09-29 14:13:50 +02:00 committed by GitHub
parent 473e0623ba
commit 8e2c3ca3f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -880,8 +880,12 @@ static void CreateCableCarSprites(void)
// 1/64 chance for an NPC to appear hiking on the ground below the Cable Car
if ((rval % 64) == 0)
{
// Unclear if this was intentional, but the - 1 in the below ARRAY_COUNT means the Zigzagoon is never used
// BUGFIX: The - 1 in the below ARRAY_COUNT means the Zigzagoon is never used
#ifdef #BUGFIX
spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % ARRAY_COUNT(hikerGraphicsIds)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106);
#else
spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % (ARRAY_COUNT(hikerGraphicsIds) - 1)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106);
#endif
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].oam.priority = 2;