Deprecate IsSoundPrecached (#1172)

Fix #1170
This commit is contained in:
naydef 2020-02-06 20:33:44 +02:00 committed by GitHub
parent 9f4c6c61d9
commit fba71ed24d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -677,11 +677,7 @@ bool InternalPrecacheScriptSound(const char *soundname)
for (int wave = 0; wave < waveCount; wave++)
{
const char* waveName = soundemitterbase->GetWaveName(internal->GetSoundNames()[wave].symbol);
// return true even if we precache no new wavs
if (!engsound->IsSoundPrecached(waveName))
{
engsound->PrecacheSound(waveName);
}
engsound->PrecacheSound(waveName);
}
return true;
@ -1590,10 +1586,7 @@ static cell_t smn_GetGameSoundParams(IPluginContext *pContext, const cell_t *par
pContext->StringToLocal(params[6], params[7], soundParams.soundname);
// Precache the sound we're returning
if (!engsound->IsSoundPrecached(soundParams.soundname))
{
InternalPrecacheScriptSound(soundname);
}
InternalPrecacheScriptSound(soundname);
return true;
}

View File

@ -322,7 +322,9 @@ native bool PrecacheSound(const char[] sound, bool preload=false);
*
* @param sound Name of the sound to check.
* @return True if precached, false otherwise.
* @deprecated Doesn't work correctly, always returns true.
*/
#pragma deprecated Doesn't work correctly, always returns true.
native bool IsSoundPrecached(const char[] sound);
/**