diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 973e2fb05..817ca6736 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -368,11 +368,16 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): higherTime = math.ceil(flightTime) lowerRange = calculateRange(maxVelocity, mass, agility, lowerTime) higherRange = calculateRange(maxVelocity, mass, agility, higherTime) + # Fof range limit is supposedly calculated based on overview (surface-to-surface) range if 'fofMissileLaunching' in self.charge.effects: rangeLimit = self.getModifiedChargeAttr("maxFOFTargetRange") if rangeLimit: lowerRange = min(lowerRange, rangeLimit) higherRange = min(higherRange, rangeLimit) + # Make range center-to-surface, as missiles spawn in the center of the ship + shipRadius = self.owner.ship.getModifiedItemAttr("radius") + lowerRange = max(0, lowerRange - shipRadius) + higherRange = max(0, higherRange - shipRadius) higherChance = flightTime - lowerTime return lowerRange, higherRange, higherChance diff --git a/graphs/data/fitDamageStats/calc/application.py b/graphs/data/fitDamageStats/calc/application.py index f0f9f4cd5..1536fe2b2 100644 --- a/graphs/data/fitDamageStats/calc/application.py +++ b/graphs/data/fitDamageStats/calc/application.py @@ -155,10 +155,11 @@ def getLauncherMult(mod, src, distance, tgtSpeed, tgtSigRadius): missileMaxRangeData = mod.missileMaxRangeData if missileMaxRangeData is None: return 0 + # The ranges already consider ship radius lowerRange, higherRange, higherChance = missileMaxRangeData - if distance is None or distance + src.getRadius() <= lowerRange: + if distance is None or distance <= lowerRange: distanceFactor = 1 - elif lowerRange < distance + src.getRadius() <= higherRange: + elif lowerRange < distance <= higherRange: distanceFactor = higherChance else: distanceFactor = 0