From 8e2c3ca3f2238765e993d005a00dbe4a6abf4a83 Mon Sep 17 00:00:00 2001 From: Scyrous <74797764+Scyrous@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:13:50 +0200 Subject: [PATCH 1/2] Bugfix for cable car sprite array count --- src/cable_car.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cable_car.c b/src/cable_car.c index 8a666a536e46..9a6166b59906 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -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; From 1dc85df1f0ab617dc402ee2da1f37097e3758461 Mon Sep 17 00:00:00 2001 From: Scyrous <74797764+Scyrous@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:38:08 +0200 Subject: [PATCH 2/2] Update cable_car.c --- src/cable_car.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cable_car.c b/src/cable_car.c index 9a6166b59906..522ea01a97ab 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -881,7 +881,7 @@ static void CreateCableCarSprites(void) if ((rval % 64) == 0) { // BUGFIX: The - 1 in the below ARRAY_COUNT means the Zigzagoon is never used -#ifdef #BUGFIX +#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);