From 83fbf1a124b2495dacdadfa238086c15569a167a Mon Sep 17 00:00:00 2001 From: dastrukar <3derid@gmail.com> Date: Thu, 30 Nov 2023 01:01:12 +0800 Subject: [PATCH] medical: Redo div by zero fix i think this should make it more consistent with the code? --- medical/module/medical_wound.zsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/medical/module/medical_wound.zsc b/medical/module/medical_wound.zsc index 14fff7e..37f4489 100644 --- a/medical/module/medical_wound.zsc +++ b/medical/module/medical_wound.zsc @@ -247,7 +247,6 @@ extend class UaS_Wound { location.y * bleeder.height); vector3 interpvel = level.Vec3Diff(oldpos, off); double avgsize = (width + depth) / 2.0; - float bludalpha = (width > 0.)? (depth / width) : 0; // Spawn a wound particle; if (depth >= 8) { BP.Texture = TexMan.CheckForTexture ("BLUDC0"); } @@ -262,7 +261,8 @@ extend class UaS_Wound { BP.Flags = SPF_REPLACE; BP.FadeStep = 0; BP.Style = STYLE_Normal; - BP.StartAlpha = min(1, max(bludalpha, 0.3)); + if (width > 0.) { BP.StartAlpha = min(1, max((depth / width), 0.3)); } + else { BP.StartAlpha = 0.3; } level.SpawnParticle(BP); // Do appearing and drops running down body