mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-23 07:27:20 +00:00
fix: Nether portal trigger and travel sounds not playing (#1523)
This commit is contained in:
parent
1a552fbd0c
commit
9167454767
|
|
@ -583,23 +583,26 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||||
{
|
{
|
||||||
U8 szSoundName[256];
|
U8 szSoundName[256];
|
||||||
wstring name;
|
wstring name;
|
||||||
|
const char* soundDir;
|
||||||
|
|
||||||
if (iSound >= eSFX_MAX)
|
if (iSound >= eSFX_MAX)
|
||||||
{
|
{
|
||||||
strcpy((char*)szSoundName, "Minecraft/");
|
strcpy((char*)szSoundName, "Minecraft/");
|
||||||
name = wchSoundNames[iSound];
|
name = wchSoundNames[iSound];
|
||||||
|
soundDir = "Minecraft";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy((char*)szSoundName, "Minecraft/UI/");
|
strcpy((char*)szSoundName, "Minecraft/UI/");
|
||||||
name = wchUISoundNames[iSound];
|
name = wchUISoundNames[iSound];
|
||||||
|
soundDir = "Minecraft/UI";
|
||||||
}
|
}
|
||||||
|
|
||||||
char* SoundName = (char*)ConvertSoundPathToName(name);
|
char* SoundName = (char*)ConvertSoundPathToName(name);
|
||||||
strcat((char*)szSoundName, SoundName);
|
strcat((char*)szSoundName, SoundName);
|
||||||
|
|
||||||
char basePath[256];
|
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];
|
char finalPath[256];
|
||||||
sprintf_s(finalPath, "%s.wav", basePath);
|
sprintf_s(finalPath, "%s.wav", basePath);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "PlayerList.h"
|
#include "PlayerList.h"
|
||||||
#include "MultiPlayerLevel.h"
|
#include "MultiPlayerLevel.h"
|
||||||
|
#include "Minecraft.h"
|
||||||
|
#include "Common/Audio/SoundEngine.h"
|
||||||
|
#include "../Minecraft.World/SoundTypes.h"
|
||||||
|
|
||||||
#include "../Minecraft.World/net.minecraft.network.packet.h"
|
#include "../Minecraft.World/net.minecraft.network.packet.h"
|
||||||
#include "../Minecraft.World/net.minecraft.world.damagesource.h"
|
#include "../Minecraft.World/net.minecraft.world.damagesource.h"
|
||||||
|
|
@ -783,6 +786,13 @@ void ServerPlayer::changeDimension(int i)
|
||||||
// 4J: Removed on the advice of the mighty King of Achievments (JV)
|
// 4J: Removed on the advice of the mighty King of Achievments (JV)
|
||||||
// awardStat(GenericStats::portal(), GenericStats::param_portal());
|
// awardStat(GenericStats::portal(), GenericStats::param_portal());
|
||||||
}
|
}
|
||||||
|
// play the travel whoosh right before the actual dimension swap
|
||||||
|
Minecraft *mc = Minecraft::GetInstance();
|
||||||
|
if (mc != nullptr && mc->soundEngine != nullptr)
|
||||||
|
{
|
||||||
|
mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i);
|
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i);
|
||||||
lastSentExp = -1;
|
lastSentExp = -1;
|
||||||
lastSentHealth = -1;
|
lastSentHealth = -1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue