Change is_alive checks

Add ent check to is_friend
This commit is contained in:
8dcc 2023-07-28 14:41:34 +02:00
parent 201bc466fb
commit eff4c70739
1 changed files with 3 additions and 4 deletions

View File

@ -22,8 +22,7 @@ cl_entity_t* get_player(int ent_idx) {
} }
bool is_alive(cl_entity_t* ent) { bool is_alive(cl_entity_t* ent) {
/* TODO */ return ent && !player_extra_info[ent->index].dead;
return ent && ent->curstate.movetype != 6 && ent->curstate.movetype != 0;
} }
bool valid_player(cl_entity_t* ent) { bool valid_player(cl_entity_t* ent) {
@ -32,7 +31,7 @@ bool valid_player(cl_entity_t* ent) {
} }
bool is_friend(cl_entity_t* ent) { bool is_friend(cl_entity_t* ent) {
return !strcmp(player_extra_info[ent->index].teamname, return ent && !strcmp(player_extra_info[ent->index].teamname,
player_extra_info[localplayer->index].teamname); player_extra_info[localplayer->index].teamname);
} }