summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-02-07 18:58:23 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:09 +0100
commit5c84a2b60360fb956715456c5edc5a21628f1d74 (patch)
treef35fd29f5a0b30b470a8d85b4b9d8fc3c43c00ae /src/game
parent069a74c854991bba55770a4f2143a4576bc47dcb (diff)
never set groundEntityNum to -1, use ENTITYNUM_NONE instead
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_buildable.c8
-rw-r--r--src/game/g_client.c2
-rw-r--r--src/game/g_mover.c4
-rw-r--r--src/game/g_physics.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 77ae43c8..58977872 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -583,7 +583,7 @@ qboolean G_FindCreep( gentity_t *self )
vec3_t temp_v;
//don't check for creep if flying through the air
- if( !self->client && self->s.groundEntityNum == -1 )
+ if( !self->client && self->s.groundEntityNum == ENTITYNUM_NONE )
return qtrue;
//if self does not have a parentNode or it's parentNode is invalid find a new one
@@ -865,7 +865,7 @@ void ASpawn_Think( gentity_t *self )
if( self->spawned )
{
//only suicide if at rest
- if( self->s.groundEntityNum )
+ if( self->s.groundEntityNum != ENTITYNUM_NONE )
{
if( ( ent = G_CheckSpawnPoint( self->s.number, self->s.origin,
self->s.origin2, BA_A_SPAWN, NULL ) ) != NULL )
@@ -1686,7 +1686,7 @@ void HSpawn_Think( gentity_t *self )
if( self->spawned )
{
//only suicide if at rest
- if( self->s.groundEntityNum )
+ if( self->s.groundEntityNum != ENTITYNUM_NONE )
{
if( ( ent = G_CheckSpawnPoint( self->s.number, self->s.origin,
self->s.origin2, BA_H_SPAWN, NULL ) ) != NULL )
@@ -3678,7 +3678,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable,
built->s.pos.trType = BG_Buildable( buildable )->traj;
built->s.pos.trTime = level.time;
built->physicsBounce = BG_Buildable( buildable )->bounce;
- built->s.groundEntityNum = -1;
+ built->s.groundEntityNum = ENTITYNUM_NONE;
built->s.generic1 = MAX( built->health, 0 );
diff --git a/src/game/g_client.c b/src/game/g_client.c
index d9f7e541..5e15162f 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -256,7 +256,7 @@ static gentity_t *G_SelectSpawnBuildable( vec3_t preference, buildable_t buildab
if( search->health <= 0 )
continue;
- if( !search->s.groundEntityNum )
+ if( search->s.groundEntityNum == ENTITYNUM_NONE )
continue;
if( search->clientSpawnTime > 0 )
diff --git a/src/game/g_mover.c b/src/game/g_mover.c
index a0df546b..0ff748eb 100644
--- a/src/game/g_mover.c
+++ b/src/game/g_mover.c
@@ -177,7 +177,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
// may have pushed them off an edge
if( check->s.groundEntityNum != pusher->s.number )
- check->s.groundEntityNum = -1;
+ check->s.groundEntityNum = ENTITYNUM_NONE;
block = G_TestEntityPosition( check );
@@ -206,7 +206,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
if( !block )
{
- check->s.groundEntityNum = -1;
+ check->s.groundEntityNum = ENTITYNUM_NONE;
pushed_p--;
return qtrue;
}
diff --git a/src/game/g_physics.c b/src/game/g_physics.c
index 52669bd8..455d3a6e 100644
--- a/src/game/g_physics.c
+++ b/src/game/g_physics.c
@@ -88,8 +88,8 @@ void G_Physics( gentity_t *ent, int msec )
trace_t tr;
int contents;
- // if groundentity has been set to -1, it may have been pushed off an edge
- if( ent->s.groundEntityNum == -1 )
+ // if groundentity has been set to ENTITYNUM_NONE, ent may have been pushed off an edge
+ if( ent->s.groundEntityNum == ENTITYNUM_NONE )
{
if( ent->s.eType == ET_BUILDABLE )
{
@@ -121,7 +121,7 @@ void G_Physics( gentity_t *ent, int msec )
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, ent->clipmask );
if( tr.fraction == 1.0f )
- ent->s.groundEntityNum = -1;
+ ent->s.groundEntityNum = ENTITYNUM_NONE;
ent->nextPhysicsTime = level.time + PHYSICS_TIME;
}