Fix another arrow-shooting Assertion

This commit is contained in:
Daniel Gibson 2018-09-02 03:42:59 +02:00
parent 6a6f4aad47
commit 40d9f20843
2 changed files with 11 additions and 3 deletions

View file

@ -3226,11 +3226,14 @@ void idEntity::AddDamageEffect( const trace_t &collision, const idVec3 &velocity
size = def->dict.GetFloat( "size_wound", "6.0" );
}
if(size > 0.0f) {
#ifdef _DENTONMOD_ENTITY_CPP
gameLocal.ProjectDecal( collision.c.point, -collision.c.normal, 8.0f, true, size, decal );
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

@ -3886,6 +3886,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 );