diff --git a/SkyPiratesCoreDev/Data/Scripts/SkyPirates/Propellers.cs b/SkyPiratesCoreDev/Data/Scripts/SkyPirates/Propellers.cs index 021579a..596c109 100644 --- a/SkyPiratesCoreDev/Data/Scripts/SkyPirates/Propellers.cs +++ b/SkyPiratesCoreDev/Data/Scripts/SkyPirates/Propellers.cs @@ -539,16 +539,31 @@ private float CalculatePropellerInterference() foreach (IMyThrust prop in plane.props) { IMySlimBlock slim = prop.SlimBlock; + + if (slim == block.SlimBlock) + continue; + Vector3I propellerPosition2 = FindPropellerTip(slim); float manhattandistance = (float)Vector3I.DistanceManhattan(propellerPosition2, propellerPosition1); - if (slim != block.SlimBlock && manhattandistance < 10) + var perpendicularDistance = CalculatePerpendicularDistance(propellerPosition1, propellerPosition2, block.SlimBlock.Orientation.Forward); + + if (manhattandistance < 10) { - var perpendicularDistance = CalculatePerpendicularDistance(propellerPosition1, propellerPosition2, block.SlimBlock.Orientation.Forward); var interference = (1.5f + prop.CurrentThrustPercentage) / (1f + (perpendicularDistance + manhattandistance) / 2); interference = Math.Min(1f, interference); interferenceModifier -= interference; - interferenceProps.Add($"{interference:P2}, ({perpendicularDistance}) from {prop.CustomName}\n"); + interferenceProps.Add($"{interference:P2}, ({perpendicularDistance}) from {prop.CustomName} (too close!)\n"); + continue; + } + + if(grid.GridSizeEnum == MyCubeSize.Small && perpendicularDistance < 5) + { + var interference = (1.5f + prop.CurrentThrustPercentage) / (1f + perpendicularDistance); + interference = Math.Min(1f, interference); + + interferenceModifier -= interference; + interferenceProps.Add($"{interference:P2}, ({perpendicularDistance}) from {prop.CustomName} (small props are inline!)\n"); } } }