From: terencehill <piuntn@gmail.com>
Date: Sat, 23 Sep 2017 16:51:05 +0000 (+0200)
Subject: Fix bots looking downwards when they reach an item going to respawn
X-Git-Tag: xonotic-v0.8.5~2378^2~55
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c19d9ac8c24087a84884e5abfca09242b02260a3;p=xonotic%2Fxonotic-data.pk3dir.git

Fix bots looking downwards when they reach an item going to respawn
---

diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc
index 8f2abb3f82..94bbd752b4 100644
--- a/qcsrc/server/bot/default/aim.qc
+++ b/qcsrc/server/bot/default/aim.qc
@@ -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);