]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't apply aim shake effect whenever a bot dies
authorterencehill <piuntn@gmail.com>
Tue, 25 Nov 2014 17:58:03 +0000 (18:58 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 25 Nov 2014 17:58:03 +0000 (18:58 +0100)
qcsrc/server/cl_player.qc

index c11e92051074b7fcbf15b208b774f14d96c00d88..0301c83556104e1fc35f21c62d60ace95820229d 100644 (file)
@@ -573,9 +573,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 
                                // throw off bot aim temporarily
                                float shake;
-                               shake = damage * 5 / (bound(0,skill,100) + 1);
-                               self.v_angle_x = self.v_angle_x + (random() * 2 - 1) * shake;
-                               self.v_angle_y = self.v_angle_y + (random() * 2 - 1) * shake;
+                               if(IS_BOT_CLIENT(self) && self.health >= 1)
+                               {
+                                       shake = damage * 5 / (bound(0,skill,100) + 1);
+                                       self.v_angle_x = self.v_angle_x + (random() * 2 - 1) * shake;
+                                       self.v_angle_y = self.v_angle_y + (random() * 2 - 1) * shake;
+                               }
                        }
                }
                else