mirror of
https://github.com/rehlds/rehlds.git
synced 2024-12-28 15:45:46 +03:00
SV_WriteEntitiesToClient: Reset movetype if the aiment index is invalid
This commit is contained in:
parent
498d7e0d18
commit
58391b6ee5
@ -4891,7 +4891,9 @@ void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg)
|
|||||||
auto &entityState = curPack->entities[i];
|
auto &entityState = curPack->entities[i];
|
||||||
if (entityState.number > MAX_CLIENTS)
|
if (entityState.number > MAX_CLIENTS)
|
||||||
{
|
{
|
||||||
if (entityState.movetype == MOVETYPE_FOLLOW && entityState.aiment > 0)
|
if (entityState.movetype == MOVETYPE_FOLLOW)
|
||||||
|
{
|
||||||
|
if (entityState.aiment > 0 && entityState.aiment < g_psv.num_edicts)
|
||||||
{
|
{
|
||||||
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1' &&
|
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1' &&
|
||||||
entityState.aiment <= MAX_CLIENTS)
|
entityState.aiment <= MAX_CLIENTS)
|
||||||
@ -4901,16 +4903,20 @@ void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg)
|
|||||||
|
|
||||||
// Prevent crash "Cache_UnlinkLRU: NULL link" on client-side
|
// Prevent crash "Cache_UnlinkLRU: NULL link" on client-side
|
||||||
// if aiment with sprite model will be to render as a studio model
|
// if aiment with sprite model will be to render as a studio model
|
||||||
if (entityState.aiment < g_psv.num_edicts)
|
|
||||||
{
|
|
||||||
edict_t *ent = &g_psv.edicts[entityState.aiment];
|
edict_t *ent = &g_psv.edicts[entityState.aiment];
|
||||||
if (ent->v.modelindex >= 0 && ent->v.modelindex < MAX_MODELS
|
if (ent->v.modelindex >= 0 && ent->v.modelindex < MAX_MODELS
|
||||||
&& (!g_psv.models[ent->v.modelindex]
|
&& (!g_psv.models[ent->v.modelindex]
|
||||||
|| g_psv.models[ent->v.modelindex]->type != mod_studio))
|
|| g_psv.models[ent->v.modelindex]->type != mod_studio))
|
||||||
{
|
{
|
||||||
entityState.aiment = 0;
|
entityState.aiment = 0;
|
||||||
|
entityState.movetype = MOVETYPE_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entityState.aiment = 0;
|
||||||
|
entityState.movetype = MOVETYPE_NONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent spam "Non-sprite set to glow!" in console on client-side
|
// Prevent spam "Non-sprite set to glow!" in console on client-side
|
||||||
|
Loading…
Reference in New Issue
Block a user