Helipad : fixed errors after merge of develop features.

This commit is contained in:
Khopa 2021-06-20 18:20:40 +02:00
parent c70169b4a0
commit e56e765450
4 changed files with 11 additions and 5 deletions

View File

@ -116,6 +116,10 @@ class AircraftType(UnitType[FlyingType]):
def flyable(self) -> bool:
return self.dcs_unit_type.flyable
@property
def helicopter(self) -> bool:
return self.dcs_unit_type.helicopter
@cached_property
def max_speed(self) -> Speed:
return kph(self.dcs_unit_type.max_speed)

View File

@ -31,6 +31,7 @@ from dcs.ships import (
)
from dcs.terrain.terrain import Airport, ParkingSlot
from dcs.unit import Unit
from dcs.unittype import FlyingType
from game import db
from game.point_with_heading import PointWithHeading
@ -44,10 +45,9 @@ from .theatergroundobject import (
GenericCarrierGroundObject,
TheaterGroundObject,
)
from ..db import PRICES
from ..helipad import Helipad
from ..dcs.aircrafttype import AircraftType
from ..dcs.groundunittype import GroundUnitType
from ..helipad import Helipad
from ..utils import nautical_miles
from ..weather import Conditions
@ -1149,7 +1149,9 @@ class Fob(ControlPoint):
def total_aircraft_parking(self) -> int:
return len(self.helipads)
def can_operate(self, aircraft: FlyingType) -> bool:
def can_operate(self, aircraft: AircraftType) -> bool:
print(aircraft)
print(aircraft.helicopter)
if aircraft.helicopter:
return True
else:

View File

@ -614,7 +614,7 @@ class HelipadGenerator:
self.m.static_group(
country=country,
name=(name + "_ammo"),
_type=Fortification.FARP_Ammo_Storage,
_type=Fortification.FARP_Ammo_Dump_Coating,
position=pad.position.point_from_heading(
helipad.heading, 35
).point_from_heading(helipad.heading + 90, 10),

View File

@ -52,7 +52,7 @@ class QAircraftRecruitmentMenu(QFrame, QRecruitBehaviour):
continue
if (
self.cp.cptype in [ControlPointType.FOB, ControlPointType.FARP]
and unit_type not in helicopter_map.values()
and not unit_type.helicopter
):
continue
unit_types.add(unit_type)