From 99c59551fd223bcf8ef8b4af48cc385b90e53bb4 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Sat, 28 Nov 2026 14:42:31 +0800 Subject: [PATCH] Show random battle vehicles before fixed support slots --- .../local-service/src/battle/battle-extra-slots.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/local-service/src/battle/battle-extra-slots.ts b/packages/local-service/src/battle/battle-extra-slots.ts index 815b70a..960535d 100644 --- a/packages/local-service/src/battle/battle-extra-slots.ts +++ b/packages/local-service/src/battle/battle-extra-slots.ts @@ -63,13 +63,16 @@ export function selectExtraBattleSlots(input: ExtraBattleSlotsInput): readonly E const room = MAX_BATTLE_CREW_SLOTS - input.slotVehicles.length; if (input.declaration.multiSlot === false || room <= 0) return []; - const slots: ExtraBattleSlot[] = []; + const supportSlots: ExtraBattleSlot[] = []; const supportPlane = supportPlaneSlot(input); - if (supportPlane) slots.push(supportPlane); + if (supportPlane) supportSlots.push(supportPlane); const ucav = strikeUcavSlot(input); - if (ucav) slots.push(ucav); + if (ucav) supportSlots.push(ucav); + // Keep room for fixed support vehicles while displaying random vehicle groups first. + const slots: ExtraBattleSlot[] = []; for (const group of input.rules.randomSpawnUnits[input.declaration.economicName]?.[input.country] ?? []) { + if (slots.length + supportSlots.length >= room) break; const options = randomGroupOptions(group, input); if (options.length === 0) continue; const chosen = options[randomInt(options.length)]!; @@ -82,7 +85,7 @@ export function selectExtraBattleSlots(input: ExtraBattleSlotsInput): readonly E }); } - return slots.slice(0, room); + return [...slots, ...supportSlots].slice(0, room); } function supportPlaneSlot(input: ExtraBattleSlotsInput): ExtraBattleSlot | undefined {