From 5989bca12795bc27e648f06a31e1e75e58c83e4d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 29 Sep 2025 22:13:12 -0500 Subject: [PATCH] playaudio related fixes soundassets in general: initialize the ease to default for the ShapeBase::updateAudioState, we never call that without first checking if the asset is defined, *and* isvalid is not valid if it's never tried loading it. so that's both redundant *and* actively counterproductive for a filter --- Engine/source/T3D/assets/SoundAsset.cpp | 2 +- Engine/source/T3D/shapeBase.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index 0b1498c6b..aa800953b 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -167,7 +167,7 @@ SoundAsset::SoundAsset() mProfileDesc.mScatterDistance = Point3F(0.f, 0.f, 0.f); mProfileDesc.mPriority = 1.0f; mProfileDesc.mSourceGroup = NULL; - + mProfileDesc.mFadeInEase = EaseF(); mIsPlaylist = false; mPlaylist.mNumSlotsToPlay = SFXPlayList::SFXPlaylistSettings::NUM_SLOTS; diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index ce42dced6..84029190f 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -2347,14 +2347,12 @@ void ShapeBase::updateAudioState(SoundThread& st) if ( isGhost() ) { // if asset is valid, play - if (st.asset->isAssetValid() ) + if (st.asset->load() == AssetBase::Ok) { - if (st.asset->load() == AssetBase::Ok) - { - st.sound = SFX->createSource(st.asset->getSFXTrack(), &getTransform()); - if (st.sound) - st.sound->play(); - } + SFXTrack* trk = st.asset->getSFXTrack(); + st.sound = SFX->createSource(trk, &getTransform()); + if (st.sound) + st.sound->play(); } else st.play = false;