From 5cf45c5937f5b96011aab630548c45259b1a461a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 19 Dec 2014 21:57:24 -0600 Subject: [PATCH] Don't use dead view angles after stop following a dead player If ps.stats[STAT_HEALTH] is less or equal to 0, cgame uses fixed view angles. When stop following a player, make sure health isn't less or equal to 0. --- code/game/g_cmds.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index fe2a53c1..e6e350f2 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -651,6 +651,11 @@ void StopFollowing( gentity_t *ent ) { ent->client->ps.pm_flags &= ~PMF_FOLLOW; ent->r.svFlags &= ~SVF_BOT; ent->client->ps.clientNum = ent - g_entities; + + // don't use dead view angles + if ( ent->client->ps.stats[STAT_HEALTH] <= 0 ) { + ent->client->ps.stats[STAT_HEALTH] = 1; + } } /*