mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Helipad : fixed errors after merge of develop features.
This commit is contained in:
parent
c70169b4a0
commit
e56e765450
@ -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)
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user