jlecorre / hlinvasion

Source code for Half-Life: Invasion, a singleplayer Half-Life modification.
15 stars 4 forks source link

Supergun reload time is missing additional delay. #6

Open malortie opened 3 years ago

malortie commented 3 years ago

The reload duration is specified as the last parameter:

https://github.com/jlecorre/hlinvasion/blob/7f494fe04acd6773bc92312ce545bd720797799b/SourceCode/dlls/supergun.cpp#L370

The number of frames (69) is divided by the FPS (25), which gives the reload duration. This is meant to match the reload sequence duration.

There are 2 issues:

  1. According to the SMD, the reload sequence has 70 frames.
  2. The operator / performs integer division, which drops the fraction portion and returns an integer, which removes additional delay.

The line should be changed as follows:

DefaultReload( SUPERGUN_MAX_CLIP, SG_RELOAD, 70.0f / 25.0f );