Skip to content

Commit a71821b

Browse files
committed
xrGame: fix sound loading on Linux
1 parent a84d7a3 commit a71821b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/xrGame/script_sound.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
CScriptSound::CScriptSound(LPCSTR caSoundName, ESoundTypes sound_type)
1818
{
19+
#ifdef LINUX
20+
while (char* sep = strchr((char *)caSoundName, '\\')) *sep = '/';
21+
#endif
1922
m_bIsNoSound = strstr(Core.Params, "-nosound");
2023
m_caSoundToPlay = caSoundName;
2124
string_path l_caFileName;
@@ -29,7 +32,7 @@ CScriptSound::CScriptSound(LPCSTR caSoundName, ESoundTypes sound_type)
2932
CScriptSound::~CScriptSound()
3033
{
3134
if (m_sound._feedback())
32-
GEnv.ScriptEngine->script_log(LuaMessageType::Error, "Playing sound is not completed, but is destroying \"%s\"!",
35+
GEnv.ScriptEngine->script_log(LuaMessageType::Error, "Playing sound is not completed, but is destroying \"%s\"!",
3336
m_sound._handle() ? m_sound._handle()->file_name() : "unknown");
3437
m_sound.destroy();
3538
}

0 commit comments

Comments
 (0)