Open hleVqq opened 5 years ago
This is the code bit:
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)
{
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1'
&& entityState.movetype == MOVETYPE_FOLLOW
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
{
attachedEntCount[entityState.aiment]++;
}
}
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]);
}
}
}
Also, it is related in mechanics to Non-sprite set to glow! #2202
Attaching an entity (aiment) to a player causes player's certain animations to double in speed (doubles everytime an entity is attached).
It's somewhat fixed by ReHLDS (at least for CS it works), but it's reproducible on other HL mods. ReHLDS cvar description: