Fix iteration of players for paintings. Causes undefined behavior otherwise. (#333)

This commit is contained in:
Prince Frizzy 2023-03-29 06:05:06 -04:00 committed by GitHub
parent c10f080d11
commit c7ccd9536e
1 changed files with 1 additions and 1 deletions

View File

@ -839,7 +839,7 @@ void painting_update_floors(struct Painting *painting) {
painting->ripples.enteredMarioIndex = -1;
painting->ripples.underMarioIndex = -1;
for (int i = 0; i < MAX_PLAYERS + 1; i++) {
for (int i = 0; i < MAX_PLAYERS; i++) {
// If the painting was entered (and not a floor painting) no need to look at everyone else this frame
if (painting->floorEntered && !floorPainting) { continue; }
struct MarioState* m = &gMarioStates[i];