mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
fix updateAudioState null crash
This commit is contained in:
parent
4f0f97c5e7
commit
155477492d
1 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue