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:
parent
74aa4268b2
commit
6e340f9a5b
4 changed files with 18 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue