From fba71ed24d1f143c5625fe5053237c389cec90f9 Mon Sep 17 00:00:00 2001 From: naydef Date: Thu, 6 Feb 2020 20:33:44 +0200 Subject: [PATCH] Deprecate IsSoundPrecached (#1172) Fix #1170 --- extensions/sdktools/vsound.cpp | 11 ++--------- plugins/include/halflife.inc | 2 ++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/extensions/sdktools/vsound.cpp b/extensions/sdktools/vsound.cpp index 88a5b90e..02ddc0c6 100644 --- a/extensions/sdktools/vsound.cpp +++ b/extensions/sdktools/vsound.cpp @@ -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; } diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index a7790cc8..60186ed2 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -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); /**