]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bots looking downwards when they reach an item going to respawn
authorterencehill <piuntn@gmail.com>
Sat, 23 Sep 2017 16:51:05 +0000 (18:51 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 23 Sep 2017 16:51:05 +0000 (18:51 +0200)
qcsrc/server/bot/default/aim.qc

index 8f2abb3f824b5745448a5fb4c16ab21545e5451b..94bbd752b4a936d94f387a5958b06d8d89c3abde 100644 (file)
@@ -184,6 +184,9 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        this.v_angle_y = this.v_angle.y - floor(this.v_angle.y / 360) * 360;
        this.v_angle_z = 0;
 
+       // invalid aim dir (can happen when bot overlaps target)
+       if(!v) return false;
+
        // get the desired angles to aim at
        //dprint(" at:", vtos(v));
        v = normalize(v);