SFX and soundasset safeties and fixe

adress several insatnaces of things like ServerPlay2D et al either not emitting sound at all, or doing so only at scene origin
This commit is contained in:
AzaezelX 2024-02-03 20:16:45 -06:00
parent 66766006d3
commit b12cd00b74
5 changed files with 69 additions and 46 deletions

View file

@ -1566,7 +1566,11 @@ void GameConnection::play2D(StringTableEntry assetId)
{
if (AssetDatabase.isDeclaredAsset(assetId))
{
postNetEvent(new SimSoundAssetEvent(assetId));
AssetPtr<SoundAsset> tempSoundAsset = assetId;
if (tempSoundAsset && tempSoundAsset->is3D())
{
postNetEvent(new SimSoundAssetEvent(assetId, SFX->getListener(0).getTransform()));
}
}
}