From 24cad0ae641d829e32ad0a7eb3593716d72bd7bc Mon Sep 17 00:00:00 2001 From: Fireblade <72758695+Firebladedoge229@users.noreply.github.com> Date: Fri, 8 May 2026 22:21:30 -0400 Subject: [PATCH] fix: cave sound crash --- Minecraft.Client/Common/Consoles_App.cpp | 5 +++++ Minecraft.World/Level.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index b9dbf717..9389a560 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -2560,6 +2560,11 @@ unsigned char CMinecraftApp::GetGameSettings(eGameSetting eVal) unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) { + if (iPad < 0 || iPad >= XUSER_MAX_COUNT || GameSettingsA[iPad] == nullptr) + { + return 0; + } + switch(eVal) { case eGameSetting_MusicVolume: diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index 47b75d79..52dd654e 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -3322,7 +3322,7 @@ void Level::tickClientSideTiles(int xo, int zo, LevelChunk *lc) if (player != nullptr && player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { // check for cave sound functionality - if (app.GetGameSettings(player->entityId, eGameSetting_CaveSounds)) + if (app.GetGameSettings(static_cast(player->getPlayerIndex()), eGameSetting_CaveSounds)) { // 4J-PB - Fixed issue with cave audio event having 2 sounds at 192k #ifdef _XBOX