mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix #2011
I tracked down the problem to `dataclass.replace` because it generates a new object. Turns out the check for "claimed" squadrons is somehow linked to the original object. Simply overwriting the original object fixes the problem.
This commit is contained in:
parent
18057af9ad
commit
6e555167e0
@ -158,12 +158,11 @@ class DefaultSquadronAssigner:
|
||||
if squadron_def is None:
|
||||
return None
|
||||
|
||||
overrides: Dict[str, Union[str, int]] = {}
|
||||
if config.name is not None:
|
||||
overrides["name"] = config.name
|
||||
squadron_def.name = config.name
|
||||
if config.nickname is not None:
|
||||
overrides["nickname"] = config.nickname
|
||||
squadron_def.nickname = config.nickname
|
||||
if config.female_pilot_percentage is not None:
|
||||
overrides["female_pilot_percentage"] = config.female_pilot_percentage
|
||||
squadron_def.female_pilot_percentage = config.female_pilot_percentage
|
||||
|
||||
return dataclasses.replace(squadron_def, **overrides)
|
||||
return squadron_def
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user