summaryrefslogtreecommitdiff
path: root/src/game/g_weapon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r--src/game/g_weapon.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index e02dd21..bc1491b 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -1015,7 +1015,7 @@ void poisonCloud( gentity_t *ent )
vec3_t range = { LEVEL1_PCLOUD_RANGE, LEVEL1_PCLOUD_RANGE, LEVEL1_PCLOUD_RANGE };
vec3_t mins, maxs;
int i, num;
- gentity_t *humanPlayer;
+ gentity_t *targ;
trace_t tr;
VectorAdd( ent->client->ps.origin, range, maxs );
@@ -1025,30 +1025,41 @@ void poisonCloud( gentity_t *ent )
num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
for( i = 0; i < num; i++ )
{
- humanPlayer = &g_entities[ entityList[ i ] ];
+ targ = &g_entities[ entityList[ i ] ];
- if( humanPlayer->client && humanPlayer->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ if( targ->client && targ->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
- if( BG_InventoryContainsUpgrade( UP_HELMET, humanPlayer->client->ps.stats ) )
+ if( BG_InventoryContainsUpgrade( UP_HELMET, targ->client->ps.stats ) )
continue;
- if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, humanPlayer->client->ps.stats ) )
+ if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, targ->client->ps.stats ) )
continue;
- trap_Trace( &tr, muzzle, NULL, NULL, humanPlayer->s.origin, humanPlayer->s.number, MASK_SOLID );
+ trap_Trace( &tr, muzzle, NULL, NULL, targ->s.origin, targ->s.number, MASK_SOLID );
//can't see target from here
if( tr.fraction < 1.0f )
continue;
- if( !( humanPlayer->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) )
+ if( !( targ->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) )
{
- humanPlayer->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED;
- humanPlayer->client->lastPoisonCloudedTime = level.time;
- humanPlayer->client->lastPoisonCloudedClient = ent;
- trap_SendServerCommand( humanPlayer->client->ps.clientNum, "poisoncloud" );
+ targ->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED;
+ targ->client->lastPoisonCloudedTime = level.time;
+ targ->client->lastPoisonCloudedClient = ent;
+ trap_SendServerCommand( targ->client->ps.clientNum, "poisoncloud" );
}
}
+
+ if( targ->client && targ->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ {
+ trap_Trace( &tr, muzzle, NULL, NULL, targ->s.origin, targ->s.number, MASK_SOLID );
+
+ if( tr.fraction < 1.0f )
+ continue;
+
+ targ->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED;
+ targ->client->lastBoostedTime = MAX( targ->client->lastBoostedTime, level.time - BOOST_TIME + LEVEL1_PCLOUD_BOOST_TIME );
+ }
}
G_UnlaggedOff( );
}