I'm approaching you with a question, you might have ideas on what is wrong here or maybe you have seen this one before.
I recently picked up the SDK of one of my mods that I haven't touched from 2019 and recompiled the dlls and started the game. There are no errors or warnings during compile; however when I go in the game there is something bothering me.
When a player is killed the body does not align to the ground 100% of the times... In like 2 out of 3 times it does not actually.
Having in mind that I haven't touched any of the animation code... and having in mind that it worked before correctly (way back in 2019...) I think there's something wrong with the HL build provided on Steam. (Build 8684 from 2020).
I tested on another build I use for dedicated server Build 4554 from 2009 and the issue is not present...
Any thoughts on how to mitigate that would be really appreciated...
if (pev->modelindex && (!m_fSequenceFinished) && (pev->deadflag == DEAD_DYING))
m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
if ( m_iRespawnFrames < 120 ) // Animations should be no longer than this
In this case m_iRespawnFrames is fps-dependent value. You may multiple it by gpGlobals->frametime. Something like this:
C++ Source Code:
m_iRespawnFrames += 10 * gpGlobals->frametime;
Добавлено 26-05-2021 в 22:54:
Napoleon321 писал: why is Valve limiting us that way?
It's not a limit, it's a too often calling of PlayerDeathThink at high framerates. At fps 60 m_iRespawnFrames reaches the value 120 in two seconds. At fps 100 it reaches same value in 1.2 seconds. And et cetera.
Добавлено 26-05-2021 в 23:05:
Same code from ReGameDLL. There is no m_iRespawnFrames variable:
C++ Source Code:
if (pev->modelindex && !m_fSequenceFinished && pev->deadflag == DEAD_DYING)
The switch is m_fSequenceFinished, not m_iRespawnFrames. As it should be, by the way.
Your snipped indeed fixed the issue; Still I'm wondering should I use it.. Normally any FPs above 125 or 144 was disallowed during AG tournaments; since it was allowing faster shooting, player spawn, gauss charge etc...