diff options
author | Tim Angus <tim@ngus.net> | 2005-06-28 01:51:28 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-06-28 01:51:28 +0000 |
commit | 0e56723b5c2e42c67bb12eca353caccc7a1a3886 (patch) | |
tree | c0069380a077d32675bc94893b5b4ed8684e2bcd /src/game/g_active.c | |
parent | 84dcdd0676075ff5f6a0da59376258a6de9522dc (diff) |
* Added ent->client->campingAtTheArmoury for the lamers
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r-- | src/game/g_active.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index b12f1e41..93360a12 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -657,6 +657,37 @@ void ClientTimerActions( gentity_t *ent, int msec ) damage, 0, MOD_POISON ); } + if( client->campingAtTheArmoury ) + { + if( client->lastBoughtAmmoTime + HUMAN_ARMOURY_CAMP_TIME < level.time ) + client->campingAtTheArmoury = qfalse; + else + { + //check if there are no armouries in range + int entityList[ MAX_GENTITIES ]; + vec3_t range = { HUMAN_ARMOURY_CAMP_DISTANCE, + HUMAN_ARMOURY_CAMP_DISTANCE, HUMAN_ARMOURY_CAMP_DISTANCE }; + vec3_t mins, maxs; + int i, num; + gentity_t *armoury; + + VectorAdd( client->ps.origin, range, maxs ); + VectorSubtract( client->ps.origin, range, mins ); + + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) + { + armoury = &g_entities[ entityList[ i ] ]; + + if( armoury->s.eType == ET_BUILDABLE && armoury->s.modelindex == BA_H_ARMOURY ) + break; + } + + if( i == num ) + client->campingAtTheArmoury = qfalse; + } + } + //replenish alien health if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { |