mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixing OCA-bug against FOBs
OCA Aircraft should be properly allowed against FOBs given Ghosti's roadbases
This commit is contained in:
parent
785ac6eacc
commit
2ec187bc9c
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
from typing import Type
|
from typing import Type
|
||||||
|
|
||||||
from game.theater import Airfield
|
from game.theater import Airfield, Fob
|
||||||
from .formationattack import (
|
from .formationattack import (
|
||||||
FormationAttackBuilder,
|
FormationAttackBuilder,
|
||||||
FormationAttackFlightPlan,
|
FormationAttackFlightPlan,
|
||||||
@ -23,7 +23,7 @@ class Builder(FormationAttackBuilder[OcaAircraftFlightPlan, FormationAttackLayou
|
|||||||
def layout(self) -> FormationAttackLayout:
|
def layout(self) -> FormationAttackLayout:
|
||||||
location = self.package.target
|
location = self.package.target
|
||||||
|
|
||||||
if not isinstance(location, Airfield):
|
if not isinstance(location, Airfield) and not isinstance(location, Fob):
|
||||||
logging.exception(
|
logging.exception(
|
||||||
f"Invalid Objective Location for OCA/Aircraft flight "
|
f"Invalid Objective Location for OCA/Aircraft flight "
|
||||||
f"{self.flight=} at {location=}."
|
f"{self.flight=} at {location=}."
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from random import randint
|
|
||||||
|
|
||||||
from game.ato.flighttype import FlightType
|
from game.ato.flighttype import FlightType
|
||||||
from game.commander.tasks.packageplanningtask import PackagePlanningTask
|
from game.commander.tasks.packageplanningtask import PackagePlanningTask
|
||||||
@ -25,6 +24,7 @@ class PlanOcaStrike(PackagePlanningTask[ControlPoint]):
|
|||||||
|
|
||||||
def propose_flights(self) -> None:
|
def propose_flights(self) -> None:
|
||||||
size = self.get_flight_size()
|
size = self.get_flight_size()
|
||||||
|
if self.target.cptype == self.target.cptype.AIRBASE:
|
||||||
self.propose_flight(FlightType.OCA_RUNWAY, size)
|
self.propose_flight(FlightType.OCA_RUNWAY, size)
|
||||||
if self.aircraft_cold_start:
|
if self.aircraft_cold_start:
|
||||||
self.propose_flight(FlightType.OCA_AIRCRAFT, 2)
|
self.propose_flight(FlightType.OCA_AIRCRAFT, 2)
|
||||||
|
|||||||
@ -1558,6 +1558,8 @@ class Fob(ControlPoint, RadioFrequencyContainer, CTLD):
|
|||||||
if not self.is_friendly(for_player):
|
if not self.is_friendly(for_player):
|
||||||
yield FlightType.STRIKE
|
yield FlightType.STRIKE
|
||||||
yield FlightType.AIR_ASSAULT
|
yield FlightType.AIR_ASSAULT
|
||||||
|
if self.total_aircraft_parking(ParkingType(True, True, True)):
|
||||||
|
yield FlightType.OCA_AIRCRAFT
|
||||||
else:
|
else:
|
||||||
yield FlightType.AEWC
|
yield FlightType.AEWC
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user