hlsdk-portable icon indicating copy to clipboard operation
hlsdk-portable copied to clipboard

Incorrect framerate calculation for animations consisting of single frame

Open FreeSlave opened this issue 11 months ago • 0 comments

The following code completely ignores the fps of the model sequence if the number of frames is 1, effectively treating the sequence like if it had fps = 1.

https://github.com/FWGS/hlsdk-portable/blob/e53009991a48cce8eea8bacc474ef886c4b70db5/dlls/animation.cpp#L250-L260

It means, for example, playing the animation of 1 frame and 30 fps is slower than playing animation of 2 frames and 2 fps.

Known affected entities: voltigore in Opposing Force appears to be "stuck" in flinch animation for the full second despite it having only 1 frame and 30 fps. Basically the sequence is intended to play the pain sound via animation event, but not "freezing" the voltigore.

FreeSlave avatar Jan 03 '25 03:01 FreeSlave