Browse Source

Merge pull request #1127 from Azaezel/alpha41/playAudioCrashfix

fix playAudio crash
Brian Roberts 1 year ago
parent
commit
a44c57aee4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Engine/source/T3D/shapeBase.cpp

+ 2 - 1
Engine/source/T3D/shapeBase.cpp

@@ -2301,8 +2301,9 @@ void ShapeBase::updateAudioState(SoundThread& st)
       if ( isGhost() ) 
       {
          // if asset is valid, play
-         if (st.asset->isAssetValid() )
+         if (st.asset.notNull())
          {
+            st.asset->loadSound();
             st.sound = SFX->createSource( st.asset->getSFXTrack() , &getTransform() );
             if ( st.sound )
                st.sound->play();