Remove hardcoded constant from Fly.
This commit is contained in:
@@ -66,9 +66,11 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
if (insideMaxRange && !insideMinRange)
|
if (insideMaxRange && !insideMinRange)
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
// Close enough (ported from old code which checked length against sqrt(50) px)
|
|
||||||
var d = target.CenterPosition - self.CenterPosition;
|
var d = target.CenterPosition - self.CenterPosition;
|
||||||
if (d.HorizontalLengthSquared < 91022)
|
|
||||||
|
// The next move would overshoot, so consider it close enough
|
||||||
|
var move = plane.FlyStep(plane.Facing);
|
||||||
|
if (d.HorizontalLengthSquared < move.HorizontalLengthSquared)
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
// Don't turn until we've reached the cruise altitude
|
// Don't turn until we've reached the cruise altitude
|
||||||
|
|||||||
Reference in New Issue
Block a user