]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_damage.qc
Damage player leaning: Skip if the target origin and hit location are the same. Preve...
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 920975bfda48b18da96c12b553e4428909d9dec1..22ed5de1ab1a68d1641b6abae6f25c32aacf35d8 100644 (file)
@@ -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\r
                if(cvar("g_leanplayer_damage"))\r
                {\r
-                       targ.leanangle_damage_loc = hitloc - targ.origin;\r
+                       if(hitloc != targ.origin) // prevents a bug\r
+                               targ.leanangle_damage_loc = hitloc - targ.origin;\r
                        targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any\r
 \r
                        // bound angles to the specified limit\r