MAde it possible to setup liveries in faction files.

This commit is contained in:
Khopa
2020-11-16 23:57:12 +01:00
committed by walterroach
parent 0b6b40a358
commit a52dc43c9e
6 changed files with 79 additions and 3 deletions

View File

@@ -714,6 +714,17 @@ class AircraftConflictGenerator:
for unit_instance in group.units:
unit_instance.livery_id = db.PLANE_LIVERY_OVERRIDES[unit_type]
# Override livery by faction file data
if flight.from_cp.captured:
faction = self.game.player_faction
else:
faction = self.game.enemy_faction
if unit_type in faction.liveries_overrides:
livery = random.choice(faction.liveries_overrides[unit_type])
for unit_instance in group.units:
unit_instance.livery_id = livery
for idx in range(0, min(len(group.units), flight.client_count)):
unit = group.units[idx]
if self.use_client: