@@ -613,16 +613,20 @@ namespace RTE {
613
613
soundContainerToHandle->Stop ();
614
614
soundContainerToHandle->Reset ();
615
615
}
616
- soundContainerToHandle->GetTopLevelSoundSet ().AddSound (ContentFile::GetPathFromHash (soundDataPointer->SoundFileHash ), false );
617
- soundContainerToHandle->SetImmobile (soundDataPointer->Immobile );
618
- soundContainerToHandle->SetAttenuationStartDistance (soundDataPointer->AttenuationStartDistance );
619
- soundContainerToHandle->SetLoopSetting (soundDataPointer->Loops );
620
- soundContainerToHandle->SetPriority (soundDataPointer->Priority );
621
- soundContainerToHandle->SetAffectedByGlobalPitch (soundDataPointer->AffectedByGlobalPitch );
622
- soundContainerToHandle->SetPosition (Vector (soundDataPointer->Position [0 ], soundDataPointer->Position [1 ]));
623
- soundContainerToHandle->SetVolume (soundDataPointer->Volume );
624
- soundContainerToHandle->SetPitch (soundDataPointer->Pitch );
625
- soundContainerToHandle->Play ();
616
+ if (std::string filePathFromHash = ContentFile::GetPathFromHash (soundDataPointer->SoundFileHash ); !filePathFromHash.empty ()) {
617
+ soundContainerToHandle->GetTopLevelSoundSet ().AddSound (filePathFromHash, false );
618
+ soundContainerToHandle->SetImmobile (soundDataPointer->Immobile );
619
+ soundContainerToHandle->SetAttenuationStartDistance (soundDataPointer->AttenuationStartDistance );
620
+ soundContainerToHandle->SetLoopSetting (soundDataPointer->Loops );
621
+ soundContainerToHandle->SetPriority (soundDataPointer->Priority );
622
+ soundContainerToHandle->SetAffectedByGlobalPitch (soundDataPointer->AffectedByGlobalPitch );
623
+ soundContainerToHandle->SetPosition (Vector (soundDataPointer->Position [0 ], soundDataPointer->Position [1 ]));
624
+ soundContainerToHandle->SetVolume (soundDataPointer->Volume );
625
+ soundContainerToHandle->SetPitch (soundDataPointer->Pitch );
626
+ soundContainerToHandle->Play ();
627
+ } else {
628
+ g_ConsoleMan.PrintString (" WARNING: Failed to play sound received from server. Hashed path was invalid for this client." );
629
+ }
626
630
break ;
627
631
case AudioMan::SOUND_STOP:
628
632
soundContainerToHandle->Stop ();
0 commit comments