fix: cave sound crash

This commit is contained in:
Fireblade 2026-05-08 22:21:30 -04:00
parent 34884f00fb
commit 24cad0ae64
2 changed files with 6 additions and 1 deletions

View file

@ -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:

View file

@ -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<int>(player->getPlayerIndex()), eGameSetting_CaveSounds))
{
// 4J-PB - Fixed issue with cave audio event having 2 sounds at 192k
#ifdef _XBOX