File tree Expand file tree Collapse file tree
Core/GameEngine/Source/Common/Audio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -443,10 +443,14 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
443443 break ;
444444 }
445445
446- if (!eventToAdd->getUninterruptable ()) {
447- if (!shouldPlayLocally (eventToAdd)) {
448- return AHSV_NotForLocal;
449- }
446+ // TheSuperHackers @info Scripted audio events are logical, i.e. synchronized across clients.
447+ // This early return cannot be taken for such audio events as it skips code that changes the logical game seed values.
448+ const Bool logicalAudio = eventToAdd->getIsLogicalAudio ();
449+ const Bool notForLocal = !eventToAdd->getUninterruptable () && !shouldPlayLocally (eventToAdd);
450+
451+ if (!logicalAudio && notForLocal)
452+ {
453+ return AHSV_NotForLocal;
450454 }
451455
452456 AudioEventRTS *audioEvent = MSGNEW (" AudioEventRTS" ) AudioEventRTS (*eventToAdd); // poolify
@@ -463,6 +467,12 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
463467 }
464468 }
465469
470+ if (notForLocal)
471+ {
472+ releaseAudioEventRTS (audioEvent);
473+ return AHSV_NotForLocal;
474+ }
475+
466476 // cull muted audio
467477 if (audioEvent->getVolume () < m_audioSettings->m_minVolume ) {
468478#ifdef INTENSIVE_AUDIO_DEBUG
You can’t perform that action at this time.
0 commit comments