Change edict_s->show_hostile from qboolean to int and add casts

This variable is used as an integer. Defining it as a qbooblean is
just wrong. Add some explicit float -> int casts while at it.
This commit is contained in:
Yamagi Burmeister 2016-12-18 09:27:56 +01:00
parent eadb063611
commit b475a527c9
2 changed files with 5 additions and 5 deletions

View file

@ -404,7 +404,7 @@ FoundTarget(edict_t *self)
level.sight_entity->light_level = 128; level.sight_entity->light_level = 128;
} }
self->show_hostile = level.time + 1; /* wake up other monsters */ self->show_hostile = (int)level.time + 1; /* wake up other monsters */
VectorCopy(self->enemy->s.origin, self->monsterinfo.last_sighting); VectorCopy(self->enemy->s.origin, self->monsterinfo.last_sighting);
self->monsterinfo.trail_time = level.time; self->monsterinfo.trail_time = level.time;
@ -577,7 +577,7 @@ FindTarget(edict_t *self)
if (r == RANGE_NEAR) if (r == RANGE_NEAR)
{ {
if ((client->show_hostile < level.time) && !infront(self, client)) if ((client->show_hostile < (int)level.time) && !infront(self, client))
{ {
return false; return false;
} }
@ -908,7 +908,7 @@ ai_checkattack(edict_t *self, float dist)
} }
else else
{ {
self->show_hostile = level.time + 1; self->show_hostile = (int)level.time + 1;
return false; return false;
} }
} }
@ -980,7 +980,7 @@ ai_checkattack(edict_t *self, float dist)
} }
} }
self->show_hostile = level.time + 1; /* wake up other monsters */ self->show_hostile = (int)level.time + 1; /* wake up other monsters */
/* check knowledge of enemy */ /* check knowledge of enemy */
enemy_vis = visible(self, self->enemy); enemy_vis = visible(self, self->enemy);

View file

@ -1033,7 +1033,7 @@ struct edict_s
int max_health; int max_health;
int gib_health; int gib_health;
int deadflag; int deadflag;
qboolean show_hostile; int show_hostile;
float powerarmor_time; float powerarmor_time;