-void DynamicHandicap_UpdateHandicap(entity player)
-{
- float handicap = DynamicHandicap_GetBaseValue(player);
- handicap = DynamicHandicap_ScaleHandicap(handicap);
- handicap = DynamicHandicap_ClampHandicap(handicap);
- Handicap_SetForcedHandicap(player, handicap);
-}
-
-float DynamicHandicap_GetBaseValue(entity player)
-{
- int kills = PlayerScore_Get(player, SP_KILLS);
- int deaths = PlayerScore_Get(player, SP_DEATHS);
- if (kills == deaths)
- {
- return 1;
- }
- if (deaths == 0)
- {
- return kills;
- }
- if (kills == 0)
- {
- return 1 / deaths;
- }
- return kills / deaths;
-}
-
-float DynamicHandicap_ScaleHandicap(float handicap)