[ioquake3] 126/136: Make bots stop attacking player after disconnect

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit c99281a0da0df95f6bb8a26676c9c5afdbaa995d
Author: Zack Middleton <zack at cloemail.com>
Date:   Wed Jun 7 21:11:50 2017 -0500

    Make bots stop attacking player after disconnect
    
    Bots did not notice player disconnected, so they kept attacking
    the last known position.
    
    Checking if entity is valid in BotEntityVisible might fix other
    similar issues too.
---
 code/game/ai_dmq3.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/code/game/ai_dmq3.c b/code/game/ai_dmq3.c
index a18df55..8f22e2f 100644
--- a/code/game/ai_dmq3.c
+++ b/code/game/ai_dmq3.c
@@ -2830,8 +2830,12 @@ float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int
 	aas_entityinfo_t entinfo;
 	vec3_t dir, entangles, start, end, middle;
 
-	//calculate middle of bounding box
 	BotEntityInfo(ent, &entinfo);
+	if (!entinfo.valid) {
+		return 0;
+	}
+
+	//calculate middle of bounding box
 	VectorAdd(entinfo.mins, entinfo.maxs, middle);
 	VectorScale(middle, 0.5, middle);
 	VectorAdd(entinfo.origin, middle, middle);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list