mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix bug in default squadron assigner/loader
The root cause of the issue are lines like "if aircraft in faction.all_aircrafts" that weren't working as intended, i.e. the condition would always fail. By implementing the __eq__ method we fix this issue, effectively making the default squadron assigner make use of squadrons instead of simply skipping them.
This commit is contained in:
parent
3a1d90ce6a
commit
171f0722dc
@ -265,6 +265,9 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
||||
|
||||
self.task_priorities.update(enrich)
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
return isinstance(other, AircraftType) and self.variant_id == other.variant_id
|
||||
|
||||
@classmethod
|
||||
def register(cls, unit_type: AircraftType) -> None:
|
||||
cls._by_name[unit_type.variant_id] = unit_type
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user