diff options
author | Tim Angus <tim@ngus.net> | 2003-12-24 03:08:49 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2003-12-24 03:08:49 +0000 |
commit | 988e67ce2a9c9eea540f6907b6fede1b70a3f3ae (patch) | |
tree | 274298833d56941fddb0f63258543c3e0f099d33 /src/game/g_buildable.c | |
parent | cdb8781108f8a7665f9b0bbd990e51b5e86449b1 (diff) |
* Added a creep projection under a locked human
* Removed some debug messages
* Severely cut down on static memory usage (130Mb)
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r-- | src/game/g_buildable.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 84e25106..4eadaf12 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1893,6 +1893,38 @@ void HSpawn_Think( gentity_t *self ) /* +=============== +G_BuildableRange + +Check whether a point is within some range of a type of buildable +=============== +*/ +qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ) +{ + int entityList[ MAX_GENTITIES ]; + vec3_t range; + vec3_t mins, maxs, dir; + int i, num; + gentity_t *ent; + + VectorSet( range, r, r, r ); + VectorAdd( origin, range, maxs ); + VectorSubtract( origin, range, mins ); + + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) + { + ent = &g_entities[ entityList[ i ] ]; + + if( ent->s.eType == ET_BUILDABLE && ent->s.modelindex == buildable && ent->spawned ) + return qtrue; + } + + return qfalse; +} + + +/* ================ G_itemFits |