minor logic cleanups. we want to ensure if we *do* set the projectile sound to empty via editor, that gets propagated

This commit is contained in:
AzaezelX 2021-10-14 15:05:49 -05:00
parent 9217c62446
commit 33210c4a1e

View file

@ -367,10 +367,9 @@ bool ProjectileData::preload(bool server, String &errorStr)
if (Sim::findObject(decalId, decal) == false)
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
_setProjectileSound(getProjectileSound());
if (getProjectileSound() != StringTable->EmptyString())
{
_setProjectileSound(getProjectileSound());
if (!getProjectileSoundProfile())
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash.");
}
@ -1101,7 +1100,7 @@ void Projectile::explode( const Point3F &p, const Point3F &n, const U32 collideT
void Projectile::updateSound()
{
if (!mDataBlock->getProjectileSound())
if (!mDataBlock->isProjectileSoundValid())
return;
if ( mSound )