From f6ef01d2c39b1cc9e7ce776bb2ccf9af4bc80686 Mon Sep 17 00:00:00 2001 From: MagicTheDev Date: Sun, 22 Dec 2024 21:54:55 -0600 Subject: [PATCH] fix hv & bb baby dragon swap --- coc/troop.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coc/troop.py b/coc/troop.py index 94b04464..5046560f 100644 --- a/coc/troop.py +++ b/coc/troop.py @@ -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,