]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Damage player leaning: Skip if the target origin and hit location are the same. Preve...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 16:37:26 +0000 (18:37 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 16:37:26 +0000 (18:37 +0200)
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