Make sure the edict isn't free.

return GetParametersForSoundEx's return value instead of always true.
This commit is contained in:
Ross Bemrose 2014-07-03 14:13:36 -04:00
parent e1d4ed0e34
commit 966841afbd

View File

@ -533,7 +533,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
if (ent > 0)
{
edict_t *edict = gamehelpers->EdictOfIndex(ent);
if (edict != NULL)
if (edict != NULL && !edict->IsFree())
{
IServerEntity *serverEnt = edict->GetIServerEntity();
if (serverEnt != NULL)
@ -544,8 +544,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
}
}
soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
return true;
return soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
}
bool InternalPrecacheScriptSound(const char *soundname)