2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-17 00:58:18 +03:00
This commit is contained in:
s1lent 2018-09-03 18:04:47 +07:00
parent 237ee46464
commit 469908f5c5
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C

View File

@ -4555,28 +4555,34 @@ void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg)
} }
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (sv_rehlds_attachedentities_playeranimationspeed_fix.value != 0) int attachedEntCount[MAX_CLIENTS + 1] = {};
for (int i = curPack->num_entities - 1; i >= 0; i--)
{ {
int attachedEntCount[MAX_CLIENTS + 1] = {}; auto &entityState = curPack->entities[i];
for (int i = curPack->num_entities - 1; i >= 0; i--) if (entityState.number > MAX_CLIENTS)
{ {
auto &entityState = curPack->entities[i]; if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1'
if (entityState.number > MAX_CLIENTS) && entityState.movetype == MOVETYPE_FOLLOW
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
{ {
if (entityState.movetype == MOVETYPE_FOLLOW attachedEntCount[entityState.aiment]++;
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
{
attachedEntCount[entityState.aiment]++;
}
} }
else
// Prevent spam "Non-sprite set to glow!" in console on client-side
if (entityState.rendermode == kRenderGlow
&& (entityState.modelindex >= 0 && entityState.modelindex < MAX_MODELS)
&& g_psv.models[entityState.modelindex]->type != mod_sprite)
{ {
if (attachedEntCount[entityState.number] != 0) entityState.rendermode = kRenderNormal;
{ }
// Each attached entity causes StudioProcessGait for player }
// But this will slow down normal animation predicting on client else
entityState.framerate /= (1 + attachedEntCount[entityState.number]); {
} if (attachedEntCount[entityState.number] != 0)
{
// Each attached entity causes StudioProcessGait for player
// But this will slow down normal animation predicting on client
entityState.framerate /= (1 + attachedEntCount[entityState.number]);
} }
} }
} }