File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Core/GameEngine/Source/Common/Audio Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -445,18 +445,19 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
445445 return AHSV_NoSound;
446446 }
447447
448- if (!eventToAdd->getUninterruptable ()) {
449- if (!shouldPlayLocally (eventToAdd)) {
450- return AHSV_NotForLocal;
451- }
452- }
453-
454448 AudioEventRTS *audioEvent = MSGNEW (" AudioEventRTS" ) AudioEventRTS (*eventToAdd); // poolify
455449 audioEvent->setPlayingHandle ( allocateNewHandle () );
456450 audioEvent->generateFilename (); // which file are we actually going to play?
457451 ((AudioEventRTS*)eventToAdd)->setPlayingAudioIndex ( audioEvent->getPlayingAudioIndex () );
458452 audioEvent->generatePlayInfo (); // generate pitch shift and volume shift now as well
459453
454+ if (!audioEvent->getUninterruptable ()) {
455+ if (!shouldPlayLocally (audioEvent)) {
456+ releaseAudioEventRTS (audioEvent);
457+ return AHSV_NotForLocal;
458+ }
459+ }
460+
460461 std::list<std::pair<AsciiString, Real> >::iterator it;
461462 for (it = m_adjustedVolumes.begin (); it != m_adjustedVolumes.end (); ++it) {
462463 if (it->first == audioEvent->getEventName ()) {
You can’t perform that action at this time.
0 commit comments