Make sure the edict isn't free.
return GetParametersForSoundEx's return value instead of always true.
This commit is contained in:
parent
e1d4ed0e34
commit
966841afbd
@ -533,7 +533,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
|
|||||||
if (ent > 0)
|
if (ent > 0)
|
||||||
{
|
{
|
||||||
edict_t *edict = gamehelpers->EdictOfIndex(ent);
|
edict_t *edict = gamehelpers->EdictOfIndex(ent);
|
||||||
if (edict != NULL)
|
if (edict != NULL && !edict->IsFree())
|
||||||
{
|
{
|
||||||
IServerEntity *serverEnt = edict->GetIServerEntity();
|
IServerEntity *serverEnt = edict->GetIServerEntity();
|
||||||
if (serverEnt != NULL)
|
if (serverEnt != NULL)
|
||||||
@ -544,8 +544,7 @@ bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
|
return soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InternalPrecacheScriptSound(const char *soundname)
|
bool InternalPrecacheScriptSound(const char *soundname)
|
||||||
|
Loading…
Reference in New Issue
Block a user