mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixed unused aircraft not using skins setup in factions files.
This commit is contained in:
parent
de0a3f929c
commit
948c1d0bb0
@ -71,6 +71,7 @@ from dcs.unittype import FlyingType, UnitType
|
|||||||
|
|
||||||
from game import db
|
from game import db
|
||||||
from game.data.cap_capabilities_db import GUNFIGHTERS
|
from game.data.cap_capabilities_db import GUNFIGHTERS
|
||||||
|
from game.factions.faction import Faction
|
||||||
from game.settings import Settings
|
from game.settings import Settings
|
||||||
from game.theater.controlpoint import (
|
from game.theater.controlpoint import (
|
||||||
Airfield,
|
Airfield,
|
||||||
@ -760,7 +761,6 @@ class AircraftConflictGenerator:
|
|||||||
if unit_type is F_14B:
|
if unit_type is F_14B:
|
||||||
unit.set_property(F_14B.Properties.INSAlignmentStored.id, True)
|
unit.set_property(F_14B.Properties.INSAlignmentStored.id, True)
|
||||||
|
|
||||||
|
|
||||||
group.points[0].tasks.append(OptReactOnThreat(OptReactOnThreat.Values.EvadeFire))
|
group.points[0].tasks.append(OptReactOnThreat(OptReactOnThreat.Values.EvadeFire))
|
||||||
|
|
||||||
channel = self.get_intra_flight_channel(unit_type)
|
channel = self.get_intra_flight_channel(unit_type)
|
||||||
@ -947,18 +947,20 @@ class AircraftConflictGenerator:
|
|||||||
|
|
||||||
if control_point.captured:
|
if control_point.captured:
|
||||||
country = player_country
|
country = player_country
|
||||||
|
faction = self.game.player_faction
|
||||||
else:
|
else:
|
||||||
country = enemy_country
|
country = enemy_country
|
||||||
|
faction = self.game.enemy_faction
|
||||||
|
|
||||||
for aircraft, available in inventory.all_aircraft:
|
for aircraft, available in inventory.all_aircraft:
|
||||||
try:
|
try:
|
||||||
self._spawn_unused_at(control_point, country, aircraft,
|
self._spawn_unused_at(control_point, country, faction, aircraft,
|
||||||
available)
|
available)
|
||||||
except NoParkingSlotError:
|
except NoParkingSlotError:
|
||||||
# If we run out of parking, stop spawning aircraft.
|
# If we run out of parking, stop spawning aircraft.
|
||||||
return
|
return
|
||||||
|
|
||||||
def _spawn_unused_at(self, control_point: Airfield, country: Country,
|
def _spawn_unused_at(self, control_point: Airfield, country: Country, faction: Faction,
|
||||||
aircraft: Type[FlyingType], number: int) -> None:
|
aircraft: Type[FlyingType], number: int) -> None:
|
||||||
for _ in range(number):
|
for _ in range(number):
|
||||||
# Creating a flight even those this isn't a fragged mission lets us
|
# Creating a flight even those this isn't a fragged mission lets us
|
||||||
@ -967,6 +969,7 @@ class AircraftConflictGenerator:
|
|||||||
flight = Flight(Package(control_point), aircraft, 1,
|
flight = Flight(Package(control_point), aircraft, 1,
|
||||||
FlightType.BARCAP, "Cold", departure=control_point,
|
FlightType.BARCAP, "Cold", departure=control_point,
|
||||||
arrival=control_point, divert=None)
|
arrival=control_point, divert=None)
|
||||||
|
|
||||||
group = self._generate_at_airport(
|
group = self._generate_at_airport(
|
||||||
name=namegen.next_unit_name(country, control_point.id,
|
name=namegen.next_unit_name(country, control_point.id,
|
||||||
aircraft),
|
aircraft),
|
||||||
@ -975,6 +978,12 @@ class AircraftConflictGenerator:
|
|||||||
count=1,
|
count=1,
|
||||||
start_type="Cold",
|
start_type="Cold",
|
||||||
airport=control_point.airport)
|
airport=control_point.airport)
|
||||||
|
|
||||||
|
if aircraft in faction.liveries_overrides:
|
||||||
|
livery = random.choice(faction.liveries_overrides[aircraft])
|
||||||
|
for unit in group.units:
|
||||||
|
unit.livery_id = livery
|
||||||
|
|
||||||
group.uncontrolled = True
|
group.uncontrolled = True
|
||||||
self.unit_map.add_aircraft(group, flight)
|
self.unit_map.add_aircraft(group, flight)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user