From 3064f61ada98d3b2cdfa46031220f77e0b45e344 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 15 Nov 2011 18:37:26 +0200 Subject: [PATCH] Damage player leaning: Skip if the target origin and hit location are the same. Prevents a bug --- data/qcsrc/server/g_damage.qc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index 920975bf..22ed5de1 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -868,7 +868,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float // lean the player based on the amount of damage taken if(cvar("g_leanplayer_damage")) { - targ.leanangle_damage_loc = hitloc - targ.origin; + if(hitloc != targ.origin) // prevents a bug + targ.leanangle_damage_loc = hitloc - targ.origin; targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any // bound angles to the specified limit -- 2.39.2