(#5016) - Calls to trap_CM_PointContents don't update their origins based on moving entities (water). Patch by Ensiform

This commit is contained in:
Thilo Schulz 2011-06-06 15:05:10 +00:00
parent 960dca2cd4
commit eec06674fa
5 changed files with 12 additions and 11 deletions

View File

@ -2015,7 +2015,7 @@ static void CG_ScanForCrosshairEntity( void ) {
}
// if the player is in fog, don't show it
content = trap_CM_PointContents( trace.endpos, 0 );
content = CG_PointContents( trace.endpos, 0 );
if ( content & CONTENTS_FOG ) {
return;
}

View File

@ -298,7 +298,7 @@ void CG_AddFragment( localEntity_t *le ) {
// if it is in a nodrop zone, remove it
// this keeps gibs from waiting at the bottom of pits of death
// and floating levels
if ( trap_CM_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) {
if ( CG_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) {
CG_FreeLocalEntity( le );
return;
}

View File

@ -1543,7 +1543,7 @@ static void CG_BreathPuffs( centity_t *cent, refEntity_t *head) {
if ( cent->currentState.eFlags & EF_DEAD ) {
return;
}
contents = trap_CM_PointContents( head->origin, 0 );
contents = CG_PointContents( head->origin, 0 );
if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ) {
return;
}
@ -2059,7 +2059,7 @@ static void CG_PlayerSplash( centity_t *cent ) {
// if the feet aren't in liquid, don't make a mark
// this won't handle moving water brushes, but they wouldn't draw right anyway...
contents = trap_CM_PointContents( end, 0 );
contents = CG_PointContents( end, 0 );
if ( !( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ) ) {
return;
}
@ -2068,7 +2068,7 @@ static void CG_PlayerSplash( centity_t *cent ) {
start[2] += 32;
// if the head isn't out of liquid, don't make a mark
contents = trap_CM_PointContents( start, 0 );
contents = CG_PointContents( start, 0 );
if ( contents & ( CONTENTS_SOLID | CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ) {
return;
}

View File

@ -186,7 +186,8 @@ int CG_PointContents( const vec3_t point, int passEntityNum ) {
continue;
}
contents |= trap_CM_TransformedPointContents( point, cmodel, ent->origin, ent->angles );
// Ensiform : Trivial change to use the projected origin & angles of moving water based entities.
contents |= trap_CM_TransformedPointContents( point, cmodel, cent->lerpOrigin, cent->lerpAngles );
}
return contents;

View File

@ -2027,8 +2027,8 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum ) {
CG_Trace( &tr, start, NULL, NULL, end, skipNum, MASK_SHOT );
sourceContentType = trap_CM_PointContents( start, 0 );
destContentType = trap_CM_PointContents( tr.endpos, 0 );
sourceContentType = CG_PointContents( start, 0 );
destContentType = CG_PointContents( tr.endpos, 0 );
// FIXME: should probably move this cruft into CG_BubbleTrail
if ( sourceContentType == destContentType ) {
@ -2115,7 +2115,7 @@ void CG_ShotgunFire( entityState_t *es ) {
// ragepro can't alpha fade, so don't even bother with smoke
vec3_t up;
contents = trap_CM_PointContents( es->pos.trBase, 0 );
contents = CG_PointContents( es->pos.trBase, 0 );
if ( !( contents & CONTENTS_WATER ) ) {
VectorSet( up, 0, 0, 8 );
CG_SmokePuff( v, up, 32, 1, 1, 1, 0.33f, 900, cg.time, 0, LEF_PUFF_DONT_SCALE, cgs.media.shotgunSmokePuffShader );
@ -2268,8 +2268,8 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh,
// do trail effects
if ( sourceEntityNum >= 0 && cg_tracerChance.value > 0 ) {
if ( CG_CalcMuzzlePoint( sourceEntityNum, start ) ) {
sourceContentType = trap_CM_PointContents( start, 0 );
destContentType = trap_CM_PointContents( end, 0 );
sourceContentType = CG_PointContents( start, 0 );
destContentType = CG_PointContents( end, 0 );
// do a complete bubble trail if necessary
if ( ( sourceContentType == destContentType ) && ( sourceContentType & CONTENTS_WATER ) ) {