diff --git a/Source/CombatExtended/Compatibility/VanillaPsycastExpanded.cs b/Source/CombatExtended/Compatibility/VanillaPsycastExpanded.cs index d4d0e27594..de508c3e1f 100644 --- a/Source/CombatExtended/Compatibility/VanillaPsycastExpanded.cs +++ b/Source/CombatExtended/Compatibility/VanillaPsycastExpanded.cs @@ -76,10 +76,13 @@ public static bool AOE_CheckIntercept(ProjectileCE projectile, Vector3 from, Vec .SelectMany(x => x.health.hediffSet.hediffs) .Where(x => x is Hediff_Overshield && x.GetType() != typeof(Hediff_Overshield)).Cast()) { - Vector3 shieldPosition = interceptor.pawn.Position.ToVector3ShiftedWithAltitude(0.5f); + Vector3 shieldPosition = interceptor.pawn.Position.ToVector3Shifted().Yto0(); float radius = interceptor.OverlaySize; - float blockRadius = radius + def.projectile.SpeedTilesPerTick + 0.1f; - if (CE_Utility.IntersectionPoint(from, newExactPos, shieldPosition, radius, out Vector3[] sect)) + if ((new Vector3(projectile.origin.x, 0, projectile.origin.y) - shieldPosition).sqrMagnitude < radius * radius) // Ensure the shield does not block outgoing projectiles + { + return false; + } + if (CE_Utility.IntersectionPoint(from.Yto0(), newExactPos.Yto0(), shieldPosition, radius, out Vector3[] sect)) { OnIntercepted(interceptor, projectile, sect); return true;