Skip to content

Commit

Permalink
Fix #483
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Sep 3, 2018
1 parent 237ee46 commit 469908f
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions rehlds/engine/sv_main.cpp
Expand Up @@ -4555,28 +4555,34 @@ void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg)
}

#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] = {};
for (int i = curPack->num_entities - 1; i >= 0; i--)
auto &entityState = curPack->entities[i];
if (entityState.number > MAX_CLIENTS)
{
auto &entityState = curPack->entities[i];
if (entityState.number > MAX_CLIENTS)
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1'
&& entityState.movetype == MOVETYPE_FOLLOW
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
{
if (entityState.movetype == MOVETYPE_FOLLOW
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
{
attachedEntCount[entityState.aiment]++;
}
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)

This comment has been minimized.

Copy link
@WPMGPRoSToTeMa

WPMGPRoSToTeMa Sep 4, 2018

Contributor

Can it be < 0?

&& g_psv.models[entityState.modelindex]->type != mod_sprite)
{
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]);
}
entityState.rendermode = kRenderNormal;
}
}
else
{
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]);
}
}
}
Expand Down

0 comments on commit 469908f

Please sign in to comment.