Fix GetGameSoundParams in CSGO (#1631)

* Fix GetGameSoundParams CSGO

* Added preprocessor comments

* Revert InternalPrecacheScriptSound
This commit is contained in:
komashchenko 2022-02-01 18:14:53 +02:00 committed by Your Name
parent 88a0a458a6
commit 370fa8209b

View File

@ -648,13 +648,20 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
if ( !soundname[0] )
return false;
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
HSOUNDSCRIPTHASH index = soundemitterbase->HashSoundName(soundname);
if(!soundemitterbase->IsValidHash(index))
return false;
#else
#if SOURCE_ENGINE >= SE_PORTAL2
HSOUNDSCRIPTHASH index = (HSOUNDSCRIPTHASH)soundemitterbase->GetSoundIndex(soundname);
#else
HSOUNDSCRIPTHANDLE index = (HSOUNDSCRIPTHANDLE)soundemitterbase->GetSoundIndex(soundname);
#endif
#endif // SOURCE_ENGINE >= SE_PORTAL2
if (!soundemitterbase->IsValidIndex(index))
return false;
#endif // SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
gender_t gender = GENDER_NONE;