[iortcw] 20/89: All: Make bots stop attacking player after disconnect
Simon McVittie
smcv at debian.org
Fri Sep 8 10:44:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51b
in repository iortcw.
commit 71ff98baaa7cd1d817a4ae2c0e27c2dead2d5b03
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Tue Jun 13 16:22:04 2017 -0400
All: Make bots stop attacking player after disconnect
---
MP/code/game/ai_dmq3.c | 6 +++++-
SP/code/game/ai_dmq3.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/MP/code/game/ai_dmq3.c b/MP/code/game/ai_dmq3.c
index 404a8f8..4044cb8 100644
--- a/MP/code/game/ai_dmq3.c
+++ b/MP/code/game/ai_dmq3.c
@@ -1317,8 +1317,12 @@ float BotEntityVisible( int viewer, vec3_t eye, vec3_t viewangles, float fov, in
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 );
diff --git a/SP/code/game/ai_dmq3.c b/SP/code/game/ai_dmq3.c
index 6a224e2..5d0c513 100644
--- a/SP/code/game/ai_dmq3.c
+++ b/SP/code/game/ai_dmq3.c
@@ -1315,8 +1315,12 @@ float BotEntityVisible( int viewer, vec3_t eye, vec3_t viewangles, float fov, in
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/iortcw.git
More information about the Pkg-games-commits
mailing list