From b25c84a1cb6149670d8074ea366978cb0911f3ed Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 4 Sep 2023 16:39:12 +0200 Subject: [PATCH] Fix Closest Point Calculation --- Classes/ST_Mutator.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/ST_Mutator.uc b/Classes/ST_Mutator.uc index 3d29dcd5..aaeb2be4 100644 --- a/Classes/ST_Mutator.uc +++ b/Classes/ST_Mutator.uc @@ -950,9 +950,9 @@ final function EnhancedHurtRadius( dir = Normal(Delta); if (Abs(Delta.Z) <= Victim.CollisionHeight) { - Closest = Victim.Location + dir * Victim.CollisionRadius; + Closest = HitLocation + Normal(DeltaXY) * (VSize(DeltaXY) - Victim.CollisionRadius); } else if (VSize(DeltaXY) <= Victim.CollisionRadius) { - Closest = Victim.Location + dir * Victim.CollisionHeight; + Closest = HitLocation + (Delta.Z - Victim.CollisionHeight) * vect(0.0, 0.0, 1.0); } else { // Closest point must be on the cylinder rims, find out where Closest = Victim.Location + dir * (Source.CollisionRadius / VSize(dir * vect(1.0, 1.0, 0.0)));