Don't use uninitialized ps from BotAI_GetClientState

If BotAI_GetPlayerState returns qfalse, ps is untouched and in
some cases means uninitialized. So don't use it if not valid.
This commit is contained in:
Zack Middleton 2017-06-07 19:02:01 -05:00
parent 74aa4268b2
commit 6e340f9a5b
4 changed files with 18 additions and 13 deletions

View file

@ -206,7 +206,10 @@ qboolean EntityIsDead(aas_entityinfo_t *entinfo) {
if (entinfo->number >= 0 && entinfo->number < MAX_CLIENTS) {
//retrieve the current client state
BotAI_GetClientState( entinfo->number, &ps );
if (!BotAI_GetClientState(entinfo->number, &ps)) {
return qfalse;
}
if (ps.pm_type != PM_NORMAL) return qtrue;
}
return qfalse;