Don't show FOB structure as a target.

This isn't perfect because the auto planner might still target it. We
need a larger refactoring for target iteration so we don't need to
remember all the special rules at each call site. For now, this restores
the 2.3.2 behavior.

Fixes https://github.com/Khopa/dcs_liberation/issues/681
This commit is contained in:
Dan Albert 2020-12-27 19:31:33 -08:00
parent 89f313295e
commit 69833f66e3

View File

@ -7,7 +7,8 @@ from PySide2.QtWidgets import (
QWidget,
)
from game.theater import Airport, ControlPoint
from game.theater import Airport, ControlPoint, Fob
from game.theater.theatergroundobject import BuildingGroundObject
from qt_ui.windows.basemenu.base_defenses.QBaseDefenseGroupInfo import \
QBaseDefenseGroupInfo
@ -30,9 +31,18 @@ class QBaseInformation(QFrame):
scroll_content.setLayout(task_box_layout)
for g in self.cp.ground_objects:
if g.airbase_group:
group_info = QBaseDefenseGroupInfo(self.cp, g, self.game)
task_box_layout.addWidget(group_info)
# Airbase groups are the objects that are hidden on the map because
# they're shown in the base menu.
if not g.airbase_group:
continue
# Of these, we need to ignore the FOB structure itself since that's
# not supposed to be targetable.
if isinstance(self.cp, Fob) and isinstance(g, BuildingGroundObject):
continue
group_info = QBaseDefenseGroupInfo(self.cp, g, self.game)
task_box_layout.addWidget(group_info)
scroll_content.setLayout(task_box_layout)
scroll = QScrollArea()