diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index fc3ae86a..b4210b17 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -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); diff --git a/Minecraft.Client/ServerPlayer.cpp b/Minecraft.Client/ServerPlayer.cpp index 883047fc..6738360a 100644 --- a/Minecraft.Client/ServerPlayer.cpp +++ b/Minecraft.Client/ServerPlayer.cpp @@ -8,6 +8,9 @@ #include "Settings.h" #include "PlayerList.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.world.damagesource.h" @@ -783,6 +786,13 @@ void ServerPlayer::changeDimension(int i) // 4J: Removed on the advice of the mighty King of Achievments (JV) // 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(shared_from_this()), i); lastSentExp = -1; lastSentHealth = -1;