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
|
||||
from typing import Type
|
||||
|
||||
from game.theater import Airfield
|
||||
from game.theater import Airfield, Fob
|
||||
from .formationattack import (
|
||||
FormationAttackBuilder,
|
||||
FormationAttackFlightPlan,
|
||||
@ -23,7 +23,7 @@ class Builder(FormationAttackBuilder[OcaAircraftFlightPlan, FormationAttackLayou
|
||||
def layout(self) -> FormationAttackLayout:
|
||||
location = self.package.target
|
||||
|
||||
if not isinstance(location, Airfield):
|
||||
if not isinstance(location, Airfield) and not isinstance(location, Fob):
|
||||
logging.exception(
|
||||
f"Invalid Objective Location for OCA/Aircraft flight "
|
||||
f"{self.flight=} at {location=}."
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from random import randint
|
||||
|
||||
from game.ato.flighttype import FlightType
|
||||
from game.commander.tasks.packageplanningtask import PackagePlanningTask
|
||||
@ -25,7 +24,8 @@ class PlanOcaStrike(PackagePlanningTask[ControlPoint]):
|
||||
|
||||
def propose_flights(self) -> None:
|
||||
size = self.get_flight_size()
|
||||
self.propose_flight(FlightType.OCA_RUNWAY, size)
|
||||
if self.target.cptype == self.target.cptype.AIRBASE:
|
||||
self.propose_flight(FlightType.OCA_RUNWAY, size)
|
||||
if self.aircraft_cold_start:
|
||||
self.propose_flight(FlightType.OCA_AIRCRAFT, 2)
|
||||
self.propose_common_escorts()
|
||||
|
||||
@ -1558,6 +1558,8 @@ class Fob(ControlPoint, RadioFrequencyContainer, CTLD):
|
||||
if not self.is_friendly(for_player):
|
||||
yield FlightType.STRIKE
|
||||
yield FlightType.AIR_ASSAULT
|
||||
if self.total_aircraft_parking(ParkingType(True, True, True)):
|
||||
yield FlightType.OCA_AIRCRAFT
|
||||
else:
|
||||
yield FlightType.AEWC
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user