Refactor ingress altitude

This commit is contained in:
Raffson 2023-04-14 13:13:19 +02:00
parent 2746636119
commit c0406e7c3c
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 5 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class DeadIngressBuilder(PydcsWaypointBuilder):
task = AttackGroup( task = AttackGroup(
miz_group.id, miz_group.id,
weapon_type=WeaponType.Guided, weapon_type=WeaponType.Guided,
altitude=round(self.flight.coalition.doctrine.ingress_altitude.meters), altitude=waypoint.alt,
) )
waypoint.tasks.append(task) waypoint.tasks.append(task)
@ -42,7 +42,7 @@ class DeadIngressBuilder(PydcsWaypointBuilder):
weapon_type=WeaponType.Unguided, weapon_type=WeaponType.Unguided,
expend=Expend.All, expend=Expend.All,
direction=math.radians(dir), direction=math.radians(dir),
altitude=round(self.flight.coalition.doctrine.ingress_altitude.meters), altitude=waypoint.alt,
) )
task.params["altitudeEnabled"] = False task.params["altitudeEnabled"] = False
waypoint.tasks.append(task) waypoint.tasks.append(task)

View File

@ -5,7 +5,7 @@ from dcs.planes import B_17G, B_52H, Tu_22M3, B_1B
from dcs.point import MovingPoint from dcs.point import MovingPoint
from dcs.task import Bombing, Expend, OptFormation, WeaponType, CarpetBombing from dcs.task import Bombing, Expend, OptFormation, WeaponType, CarpetBombing
from game.utils import mach from game.utils import mach, meters
from .pydcswaypointbuilder import PydcsWaypointBuilder from .pydcswaypointbuilder import PydcsWaypointBuilder
@ -38,7 +38,7 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
weapon_type=WeaponType.Bombs, weapon_type=WeaponType.Bombs,
expend=Expend.All, expend=Expend.All,
carpet_length=avg_spacing, carpet_length=avg_spacing,
altitude=round(self.flight.coalition.doctrine.ingress_altitude.meters), altitude=waypoint.alt,
) )
waypoint.tasks.append(bombing) waypoint.tasks.append(bombing)
@ -53,8 +53,7 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
bombing.params["expend"] = Expend.All.value bombing.params["expend"] = Expend.All.value
waypoint.tasks.append(bombing) waypoint.tasks.append(bombing)
doctrine = self.flight.coalition.doctrine waypoint.speed = mach(0.85, meters(waypoint.alt)).meters_per_second
waypoint.speed = mach(0.85, doctrine.ingress_altitude).meters_per_second
# Register special waypoints # Register special waypoints
self.register_special_waypoints(self.waypoint.targets) self.register_special_waypoints(self.waypoint.targets)