Skip to content

Commit

Permalink
fix hv & bb baby dragon swap
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Dec 23, 2024
1 parent d4b94d7 commit f6ef01d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions coc/troop.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ def _load_json(self, english_aliases: dict, lab_to_townhall):
troop_name = english_aliases.get(troop_meta.get("TID"))

new_troop: Type[Troop] = type('Troop', Troop.__bases__, dict(Troop.__dict__))
troop_id = army_link_ids.get(troop_name, (id := id +1))

# hacky way to prevent builder base baby dragon from taking spot of home village one
troop_id = army_link_ids.get(
f"BB_{troop_name}" if troop_meta.get("VillageType") else troop_name,
(id := id + 1)
)
new_troop._load_json_meta(
troop_meta,
id=troop_id,
Expand Down

0 comments on commit f6ef01d

Please sign in to comment.