mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix small issue with ground object menu when the ground object is empty.
This commit is contained in:
parent
d213fa1b91
commit
21c355bc9f
@ -197,6 +197,7 @@ class AircraftConflictGenerator:
|
|||||||
try:
|
try:
|
||||||
return self._generate_at_airport(name, side, unit_type, count, client_count, at)
|
return self._generate_at_airport(name, side, unit_type, count, client_count, at)
|
||||||
except NoParkingSlotError:
|
except NoParkingSlotError:
|
||||||
|
logging.info("No parking slot found at " + at.name + ", switching to air start.")
|
||||||
pass
|
pass
|
||||||
return self._generate_inflight(name, side, unit_type, count, client_count, at.position)
|
return self._generate_inflight(name, side, unit_type, count, client_count, at.position)
|
||||||
else:
|
else:
|
||||||
@ -255,16 +256,21 @@ class AircraftConflictGenerator:
|
|||||||
def generate_flights(self, cp, country, flight_planner:FlightPlanner):
|
def generate_flights(self, cp, country, flight_planner:FlightPlanner):
|
||||||
|
|
||||||
# Clear pydcs parking slots
|
# Clear pydcs parking slots
|
||||||
|
logging.info("CLEARING SLOTS @ " + cp.airport.name)
|
||||||
|
logging.info("===============")
|
||||||
if cp.airport is not None:
|
if cp.airport is not None:
|
||||||
for ps in cp.airport.parking_slots:
|
for ps in cp.airport.parking_slots:
|
||||||
|
logging.info("SLOT : " + str(ps.unit_id))
|
||||||
ps.unit_id = None
|
ps.unit_id = None
|
||||||
|
logging.info("----------------")
|
||||||
|
logging.info("===============")
|
||||||
|
|
||||||
for flight in flight_planner.flights:
|
for flight in flight_planner.flights:
|
||||||
|
|
||||||
if flight.client_count == 0 and self.game.position_culled(flight.from_cp.position):
|
if flight.client_count == 0 and self.game.position_culled(flight.from_cp.position):
|
||||||
logging.info("Flight not generated : culled")
|
logging.info("Flight not generated : culled")
|
||||||
continue
|
continue
|
||||||
|
logging.info("Generating flight : " + str(flight.unit_type))
|
||||||
group = self.generate_planned_flight(cp, country, flight)
|
group = self.generate_planned_flight(cp, country, flight)
|
||||||
self.setup_flight_group(group, flight, flight.flight_type)
|
self.setup_flight_group(group, flight, flight.flight_type)
|
||||||
self.setup_group_activation_trigger(flight, group)
|
self.setup_group_activation_trigger(flight, group)
|
||||||
@ -324,7 +330,7 @@ class AircraftConflictGenerator:
|
|||||||
def generate_planned_flight(self, cp, country, flight:Flight):
|
def generate_planned_flight(self, cp, country, flight:Flight):
|
||||||
try:
|
try:
|
||||||
if flight.client_count == 0 and self.game.settings.perf_ai_parking_start:
|
if flight.client_count == 0 and self.game.settings.perf_ai_parking_start:
|
||||||
flight.start_type = "Warm"
|
flight.start_type = "Cold"
|
||||||
|
|
||||||
if flight.start_type == "In Flight":
|
if flight.start_type == "In Flight":
|
||||||
group = self._generate_group(
|
group = self._generate_group(
|
||||||
@ -360,8 +366,10 @@ class AircraftConflictGenerator:
|
|||||||
client_count=0,
|
client_count=0,
|
||||||
airport=cp.airport,
|
airport=cp.airport,
|
||||||
start_type=st)
|
start_type=st)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# Generated when there is no place on Runway or on Parking Slots
|
# Generated when there is no place on Runway or on Parking Slots
|
||||||
|
logging.error(e)
|
||||||
|
logging.warning("No room on runway or parking slots. Starting from the air.")
|
||||||
flight.start_type = "In Flight"
|
flight.start_type = "In Flight"
|
||||||
group = self._generate_group(
|
group = self._generate_group(
|
||||||
name=namegen.next_unit_name(country, cp.id, flight.unit_type),
|
name=namegen.next_unit_name(country, cp.id, flight.unit_type),
|
||||||
|
|||||||
@ -4,8 +4,6 @@ from dcs.unittype import UnitType
|
|||||||
|
|
||||||
from theater import db
|
from theater import db
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class QRecruitBehaviour:
|
class QRecruitBehaviour:
|
||||||
|
|
||||||
game = None
|
game = None
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class QGroundObjectMenu(QDialog):
|
|||||||
|
|
||||||
self.doLayout()
|
self.doLayout()
|
||||||
|
|
||||||
if len(self.ground_object.groups) > 0:
|
if self.ground_object.dcs_identifier == "AA":
|
||||||
self.mainLayout.addWidget(self.intelBox)
|
self.mainLayout.addWidget(self.intelBox)
|
||||||
else:
|
else:
|
||||||
self.mainLayout.addWidget(self.buildingBox)
|
self.mainLayout.addWidget(self.buildingBox)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user