Skip to content

Commit

Permalink
Battlegroup fix for update 1.2.0 (#224)
Browse files Browse the repository at this point in the history
* fix: hide unfinished wehr BGs

* fix: correctly map luftwaffe at emplacement
  • Loading branch information
KingDarBoja authored Jul 26, 2023
1 parent f9d0653 commit a86e3eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/unitStats/battlegroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export type BattlegroupResolvedType = {
};
};

/** Update 1.2.0 added two incomplete battlegroups, so better hide those. */
const SkipBattlegroups = ["defense", "coastal"];

/** Resolve the battlegroup branches with the corresponding upgrades. */
export function resolveBattlegroupBranches(
race: raceType,
Expand All @@ -59,7 +62,9 @@ export function resolveBattlegroupBranches(
abilities: AbilitiesType[],
) {
const faction = race === "dak" ? "afrika_korps" : race;
const battlegroupsByFaction = battlegroups.filter((x) => x.faction === faction);
const battlegroupsByFaction = battlegroups.filter(
(x) => x.faction === faction && !SkipBattlegroups.includes(x.id),
);
return battlegroupsByFaction.map<BattlegroupResolvedType>((rawBattlegroup) => {
const leftBranchUpgrades: BattleGroupUpgradeType[] = [];
const rightBranchUpgrades: BattleGroupUpgradeType[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/unitStats/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function setBattlegroupsWorkarounds() {
break;
case "luftwaffe_left_3_88mm_at_gun_ger":
/** The ability enables building the emplacement. */
upg.spawnItems = ["aa_gun_20mm_emplacement_ger"];
upg.spawnItems = ["at_gun_88mm_emplacement_ger"];
break;
}
});
Expand Down

0 comments on commit a86e3eb

Please sign in to comment.