From 936ebc01eabd13eec1ed8040aaa4b984f3dda898 Mon Sep 17 00:00:00 2001
From: Martin Taibr <taibr.martin@gmail.com>
Date: Fri, 30 Dec 2016 03:06:00 +0100
Subject: [PATCH] simplify cl_handicap, update description

---
 defaultXonotic.cfg     | 2 +-
 qcsrc/server/player.qc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index bf35a4189..b2683e2d0 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -1072,7 +1072,7 @@ alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_sh
 
 set sv_clones 0	"number of clones a player may make (reset by the \"kill\" command)"
 
-set cl_handicap 1	"the higher, the more damage you will receive (client setting) NOTE: reconnect or use sendcvar command to update the choice."
+set cl_handicap 1	"multiplies damage received and divides damage dealt NOTE: reconnect or use 'sendcvar cl_handicap' to update the choice."
 
 seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice."
 
diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc
index 9cccbe887..59f0c8029 100644
--- a/qcsrc/server/player.qc
+++ b/qcsrc/server/player.qc
@@ -318,9 +318,9 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
 
 	if(!DEATH_ISSPECIAL(deathtype))
 	{
-		damage *= sqrt(bound(1.0, this.cvar_cl_handicap, 100.0));
+		damage *= bound(1.0, this.cvar_cl_handicap, 10.0);
 		if(this != attacker)
-			damage /= sqrt(bound(1.0, attacker.cvar_cl_handicap, 100.0));
+			damage /= bound(1.0, attacker.cvar_cl_handicap, 10.0);
 	}
 
 	if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
-- 
2.39.5