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 committed 2017-06-07 19:02:20 -05:00
1 parent 74aa4268b2
commit 6e340f9a5b
4 files changed
+18 -13

No files matched your search

+4 -1
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;