4 /// \brief Source file that contains implementation of the handicap system.
6 /// \copyright GNU GPLv2 or any later version.
8 #include <common/state.qh>
11 .float m_handicap; ///< Holds the handicap value.
13 void Handicap_Initialize(entity player)
15 CS(player).m_handicap = 1;
18 float Handicap_GetVoluntaryHandicap(entity player)
20 return bound(1.0, CS(player).cvar_cl_handicap, 10.0);
23 float Handicap_GetForcedHandicap(entity player)
25 return CS(player).m_handicap;
28 void Handicap_SetForcedHandicap(entity player, float value)
32 error("Handicap_SetForcedHandicap: Invalid handicap value.");
34 CS(player).m_handicap = value;
37 float Handicap_GetTotalHandicap(entity player)
39 return Handicap_GetForcedHandicap(player) * Handicap_GetVoluntaryHandicap(