Fix another arrow-shooting Assertion (from Rivensin)

This commit is contained in:
Daniel Gibson 2018-09-02 03:42:59 +02:00
parent 351a1744a7
commit f0ff1f878d
2 changed files with 12 additions and 4 deletions

View file

@ -3160,11 +3160,14 @@ void idEntity::AddDamageEffect( const trace_t &collision, const idVec3 &velocity
size = def->dict.GetFloat( "size_wound", "6.0" );
}
#ifdef _DENTONMOD_ENTITY_CPP
gameLocal.ProjectDecal( collision.c.point, -collision.c.normal, 8.0f, true, size, decal );
if(size > 0.0f) {
#ifdef _DENTONMOD_ENTITY_CPP
gameLocal.ProjectDecal( collision.c.point, -collision.c.normal, 8.0f, true, size, decal );
#else
ProjectOverlay( collision.c.point, dir, size, decal ); // added by Clone JCD
#endif // Modified for custom wound size
ProjectOverlay( collision.c.point, dir, size, decal ); // added by Clone JCD
#endif // Modified for custom wound size
}
}
}

View file

@ -3839,6 +3839,11 @@ void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float d
return;
}
// DG: with size 0 we get trouble in functions called from this,
// and it's harder to figure out the cause there
// so just catch this here (so please fix the caller to make sure it doesn't happen)
assert(size > 0.0f);
// randomly rotate the decal winding
idMath::SinCos16( ( angle ) ? angle : random.RandomFloat() * idMath::TWO_PI, s, c );