sound system: warn about missing sounds (in debug mode only)

shapetextures
David Dormagen 2015-12-10 19:35:55 +01:00
parent 1cf188bb45
commit 35fe8f8683
1 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,12 @@ C4SoundInstance *C4SoundSystem::NewEffect(const char *szSndName, bool fLoop, int
if (!Config.Sound.RXSound) return NULL;
// Get sound
C4SoundEffect *csfx;
if (!(csfx=GetEffect(szSndName))) return NULL;
if (!(csfx = GetEffect(szSndName)))
{
// Warn about missing or incorrectly spelled sound to allow finding mistakes earlier.
DebugLogF("Warning: could not find sound matching '%s'", szSndName);
return NULL;
}
// Play
return csfx->New(fLoop, iVolume, pObj, iCustomFalloffDistance, iPitch, modifier);
}