diff --git a/src/game/skybox.c b/src/game/skybox.c index 46cb42c2..93c8038c 100644 --- a/src/game/skybox.c +++ b/src/game/skybox.c @@ -210,6 +210,11 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) for (row = 0; row < 3; row++) { for (col = 0; col < 3; col++) { s32 tileIndex = sSkyBoxInfo[player].upperLeftTile + row * SKYBOX_COLS + col; + + if (tileIndex >= SKYBOX_ROWS * SKYBOX_COLS) { + continue; + } + const u8 *const texture = (*(SkyboxTexture *) segmented_to_virtual(sSkyboxTextures[background]))[tileIndex]; Vtx *vertices = make_skybox_rect(tileIndex, colorIndex);