From 40d9f20843149cfe8b6010dfca0ee719de5bff64 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 2 Sep 2018 03:42:59 +0200 Subject: [PATCH] Fix another arrow-shooting Assertion --- game/Entity.cpp | 9 ++++++--- game/Game_local.cpp | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/game/Entity.cpp b/game/Entity.cpp index 25051b5..b886c81 100644 --- a/game/Entity.cpp +++ b/game/Entity.cpp @@ -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 + } } } diff --git a/game/Game_local.cpp b/game/Game_local.cpp index 0598ee1..2f752e3 100644 --- a/game/Game_local.cpp +++ b/game/Game_local.cpp @@ -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 );