From a77484665959835915b8a8363dc7e8429384a154 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sun, 18 Dec 2016 09:11:58 +0100 Subject: [PATCH] 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. --- src/game/g_ai.c | 8 ++++---- src/game/header/local.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/g_ai.c b/src/game/g_ai.c index 20257656..49f87240 100644 --- a/src/game/g_ai.c +++ b/src/game/g_ai.c @@ -437,7 +437,7 @@ FoundTarget(edict_t *self) 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); self->monsterinfo.trail_time = level.time; @@ -616,7 +616,7 @@ FindTarget(edict_t *self) 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; } @@ -976,7 +976,7 @@ ai_checkattack(edict_t *self) } else { - self->show_hostile = level.time + 1; + self->show_hostile = (int)level.time + 1; return false; } } @@ -1049,7 +1049,7 @@ ai_checkattack(edict_t *self) } /* wake up other monsters */ - self->show_hostile = level.time + 1; + self->show_hostile = (int)level.time + 1; /* check knowledge of enemy */ enemy_vis = visible(self, self->enemy); diff --git a/src/game/header/local.h b/src/game/header/local.h index 6ceed1aa..b1aebd41 100644 --- a/src/game/header/local.h +++ b/src/game/header/local.h @@ -1017,7 +1017,7 @@ struct edict_s int max_health; int gib_health; int deadflag; - qboolean show_hostile; + int show_hostile; float powerarmor_time;