diff options
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r-- | src/game/g_weapon.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 2afa24b7..4496d18a 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -179,7 +179,10 @@ void meleeAttack( gentity_t *ent, float range, float width, int damage, meansOfD VectorMA( muzzle, range, forward, end ); + G_UnlaggedOn( muzzle, range ); trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -223,7 +226,16 @@ void bulletFire( gentity_t *ent, float spread, int damage, int mod ) VectorMA( end, r, right, end ); VectorMA( end, u, up, end ); - trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + // don't use unlagged if this is not a client (e.g. turret) + if( ent->client ) + { + G_UnlaggedOn( muzzle, 8192 * 16 ); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + } + else + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -308,8 +320,9 @@ void shotgunFire( gentity_t *ent ) SnapVector( tent->s.origin2 ); tent->s.eventParm = rand() & 255; // seed for spread pattern tent->s.otherEntityNum = ent->s.number; - + G_UnlaggedOn( muzzle, 8192 * 16 ); ShotgunPattern( tent->s.pos.trBase, tent->s.origin2, tent->s.eventParm, ent ); + G_UnlaggedOff(); } /* @@ -329,7 +342,10 @@ void massDriverFire( gentity_t *ent ) VectorMA( muzzle, 8192 * 16, forward, end ); + G_UnlaggedOn( muzzle, 8192 * 16 ); trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -482,7 +498,10 @@ void lasGunFire( gentity_t *ent ) VectorMA( muzzle, 8192 * 16, forward, end ); + G_UnlaggedOn( muzzle, 8192 * 16 ); trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -534,7 +553,10 @@ void painSawFire( gentity_t *ent ) VectorMA( muzzle, PAINSAW_RANGE, forward, end ); + G_UnlaggedOn( muzzle, PAINSAW_RANGE ); trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -805,7 +827,9 @@ qboolean CheckVenomAttack( gentity_t *ent ) VectorMA( muzzle, LEVEL0_BITE_RANGE, forward, end ); + G_UnlaggedOn( muzzle, LEVEL0_BITE_RANGE ); trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); if( tr.surfaceFlags & SURF_NOIMPACT ) return qfalse; @@ -939,6 +963,7 @@ void poisonCloud( gentity_t *ent ) VectorAdd( ent->client->ps.origin, range, maxs ); VectorSubtract( ent->client->ps.origin, range, mins ); + G_UnlaggedOn( ent->client->ps.origin, LEVEL1_PCLOUD_RANGE ); num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); for( i = 0; i < num; i++ ) { @@ -967,6 +992,7 @@ void poisonCloud( gentity_t *ent ) } } } + G_UnlaggedOff( ); } @@ -1231,7 +1257,9 @@ void areaZapFire( gentity_t *ent ) VectorMA( muzzle, LEVEL2_AREAZAP_RANGE, forward, end ); + G_UnlaggedOn( muzzle, LEVEL2_AREAZAP_RANGE ); trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); if( tr.surfaceFlags & SURF_NOIMPACT ) return; @@ -1291,7 +1319,9 @@ qboolean CheckPounceAttack( gentity_t *ent ) VectorMA( muzzle, LEVEL3_POUNCE_RANGE, forward, end ); + G_UnlaggedOn( muzzle, LEVEL3_POUNCE_RANGE ); trap_Trace( &tr, ent->s.origin, mins, maxs, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); //miss if( tr.fraction >= 1.0 ) |