fix: Nether portal trigger and travel sounds not playing (#1523)

This commit is contained in:
dtentiion 2026-04-18 23:47:18 +01:00 committed by GitHub
parent 1a552fbd0c
commit 9167454767
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -583,23 +583,26 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
{
U8 szSoundName[256];
wstring name;
const char* soundDir;
if (iSound >= eSFX_MAX)
{
strcpy((char*)szSoundName, "Minecraft/");
name = wchSoundNames[iSound];
soundDir = "Minecraft";
}
else
{
strcpy((char*)szSoundName, "Minecraft/UI/");
name = wchUISoundNames[iSound];
soundDir = "Minecraft/UI";
}
char* SoundName = (char*)ConvertSoundPathToName(name);
strcat((char*)szSoundName, SoundName);
char basePath[256];
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name));
sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
char finalPath[256];
sprintf_s(finalPath, "%s.wav", basePath);