fix updateAudioState null crash

This commit is contained in:
AzaezelX 2023-11-12 21:32:24 -06:00
parent 4f0f97c5e7
commit 155477492d

View file

@ -2303,9 +2303,12 @@ void ShapeBase::updateAudioState(SoundThread& st)
// if asset is valid, play
if (st.asset->isAssetValid() )
{
st.sound = SFX->createSource( st.asset->getSFXTrack() , &getTransform() );
if ( st.sound )
st.sound->play();
if (st.asset->load() == AssetBase::Ok)
{
st.sound = SFX->createSource(st.asset->getSFXTrack(), &getTransform());
if (st.sound)
st.sound->play();
}
}
else
st.play = false;