fix(battle): preserve the Bullet Hell AI loadout flow
Use the game mode declaration to omit offline combat-preset selection in the cannon-only mode.
This commit is contained in:
1 parent
b4af034756
commit
01f7b5769b
4 files changed
+7
-3
No files matched your search
@@ -151,7 +151,7 @@ export class BattleMatchmaker {
|
||||
minMrank,
|
||||
maxMrank,
|
||||
limitPerType: this.#tuning.botPoolLimitPerType,
|
||||
}, this.#aircraftLoadouts);
|
||||
}, declaration.allowBotAircraftLoadouts === false ? undefined : this.#aircraftLoadouts);
|
||||
return {
|
||||
ok: true,
|
||||
launch: this.#buildLaunchPlan(input, chosenMode, mission, coalitions, playerMrank, minMrank, maxMrank, customBots),
|
||||
|
||||
@@ -108,14 +108,14 @@ export function lineupMrank(
|
||||
}
|
||||
|
||||
export function selectCustomBots(
|
||||
vehicles: readonly CatalogueVehicle[], query: BotPoolQuery, aircraftLoadouts: ReadonlyMap<string, BotAircraftLoadout>,
|
||||
vehicles: readonly CatalogueVehicle[], query: BotPoolQuery, aircraftLoadouts?: ReadonlyMap<string, BotAircraftLoadout>,
|
||||
): CustomBotsPool {
|
||||
const allowed = new Set(query.allowedClasses);
|
||||
const orderedCountries = [...new Set(query.countries.map((c) => (c.startsWith(COUNTRY_PREFIX) ? c : `${COUNTRY_PREFIX}${c}`)))];
|
||||
const aircrafts = allowed.has('aircraft') ? pickCategoryPool(vehicles, orderedCountries, 'aircraft', query) : [];
|
||||
return {
|
||||
tanks: allowed.has('tank') ? pickCategoryPool(vehicles, orderedCountries, 'tank', query) : [],
|
||||
aircrafts: query.requiredClass === 'aircraft' ? aircrafts.map((entry) => {
|
||||
aircrafts: query.requiredClass === 'aircraft' && aircraftLoadouts ? aircrafts.map((entry) => {
|
||||
const aircraftLoadout = aircraftLoadouts.get(entry.name);
|
||||
return aircraftLoadout === undefined ? entry : { ...entry, aircraftLoadout };
|
||||
}) : aircrafts,
|
||||
|
||||
Reference in new issue
Block a user