Skip to content

Commit 816c7fc

Browse files
naydefHeadline
authored andcommitted
Deprecate IsSoundPrecached (#1172)
Fix #1170
1 parent 2896435 commit 816c7fc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

extensions/sdktools/vsound.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,7 @@ bool InternalPrecacheScriptSound(const char *soundname)
677677
for (int wave = 0; wave < waveCount; wave++)
678678
{
679679
const char* waveName = soundemitterbase->GetWaveName(internal->GetSoundNames()[wave].symbol);
680-
// return true even if we precache no new wavs
681-
if (!engsound->IsSoundPrecached(waveName))
682-
{
683-
engsound->PrecacheSound(waveName);
684-
}
680+
engsound->PrecacheSound(waveName);
685681
}
686682

687683
return true;
@@ -1590,10 +1586,7 @@ static cell_t smn_GetGameSoundParams(IPluginContext *pContext, const cell_t *par
15901586
pContext->StringToLocal(params[6], params[7], soundParams.soundname);
15911587

15921588
// Precache the sound we're returning
1593-
if (!engsound->IsSoundPrecached(soundParams.soundname))
1594-
{
1595-
InternalPrecacheScriptSound(soundname);
1596-
}
1589+
InternalPrecacheScriptSound(soundname);
15971590

15981591
return true;
15991592
}

plugins/include/halflife.inc

+2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ native bool PrecacheSound(const char[] sound, bool preload=false);
322322
*
323323
* @param sound Name of the sound to check.
324324
* @return True if precached, false otherwise.
325+
* @deprecated Doesn't work correctly, always returns true.
325326
*/
327+
#pragma deprecated Doesn't work correctly, always returns true.
326328
native bool IsSoundPrecached(const char[] sound);
327329

328330
/**

0 commit comments

Comments
 (0)