summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index c81cd050..885d1d47 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -3493,12 +3493,15 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command)
default:
break;
}
+#ifdef FIX_BUGS
+ /* BUG: if audio is not initialized, this object will not be freed. */
+ if (!DMAudio.IsAudioInitialised())
+ return 0;
+#endif
cAudioScriptObject* obj = new cAudioScriptObject();
obj->Posn = *(CVector*)&ScriptParams[0];
obj->AudioId = ScriptParams[3];
obj->AudioEntity = AEHANDLE_NONE;
- /* BUG: if audio is not initialized, this object will not be freed. */
- /* Issue needs to be addressed in CreateOneShotScriptObject. */
DMAudio.CreateOneShotScriptObject(obj);
return 0;
}