fix updateAudioState null crash

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

View file

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