Read the range factor where the delivery point is decided; mines and unauthored stats go through the one function
A no-lock fused round reads RangeFactor in CommitBurst at the distance it travelled to the hull it stops on; every round whose point Solve plans reads it once at Fire (PendingShot.DeliveredAtCommit says which). Lay reads it at its own distance 0. PerformanceStat.Evaluate no longer interpolates a single-value span, so an unauthored +infinity stat evaluates unequipped. Tests: the round that stops short, the Fused Rounds hull ahead, a mine layer's authored ranges, the group pick at the target's real distance, unequipped SRMM72/Mine Launcher. Not yet built (verify job follows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
521cb6b9d5
commit
b713c42503
6 changed files with 173 additions and 18 deletions
|
|
@ -725,7 +725,10 @@ public class PerformanceStat
|
|||
_ => throw new ArgumentOutOfRangeException(nameof(term.Source), term.Source, $"Unknown StatSource on {Min}-{Max} stat")
|
||||
};
|
||||
}
|
||||
return (lerp(Min, Max, factor) * context.ScaleModifier(this) + context.ConstantModifier(this)) * powerMultiplier;
|
||||
// A stat whose span is a single value has nothing to interpolate: an unauthored stat is +infinity at both ends
|
||||
// (Tracking, EffectiveRange), and lerp(+inf, +inf, f) is NaN.
|
||||
var interpolated = Min == Max ? Min : lerp(Min, Max, factor);
|
||||
return (interpolated * context.ScaleModifier(this) + context.ConstantModifier(this)) * powerMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue