Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for cable car hikerGraphicsIds array #2039

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/cable_car.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down