From 48f01b533ef8cfe7d048f408f99c488ffd712d53 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Fri, 4 Dec 2026 19:55:03 +0800 Subject: [PATCH] fix(patcher): strip cross-promo locks so promo gift vehicles can be ordered Strip isCrossPromo and crossPromoBanner from config/shop.blk entries alongside tech-tree hiding flags so cross-promotion gift vehicles (bf-109c_1_promo, us_m4_sherman_promo, jp_destroyer_hatsuzuki) can be ordered directly through their generated local store packs while keeping showOnlyWhenBought intact. --- .../src/tech-tree/reveal-hidden-vehicles.ts | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts b/packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts index 8237776..50be1a1 100644 --- a/packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts +++ b/packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts @@ -15,21 +15,45 @@ * not been given them: event and promotion prizes, mission copies of tree vehicles (nt_f_4e, * f_4e_event ...), the drones of the premium columns, the floatplanes that come with ships, * and the launchers of the split air-defence systems (lab round 20, user feedback). + * + * Cross-promotion gift vehicles (e.g. us_m4_sherman_promo, bf-109c_1_promo, + * jp_destroyer_hatsuzuki) also carry `isCrossPromo:b` and `crossPromoBanner:t`. When + * `isCrossPromo` is true, stock client scripts (availabilitybuyonline.nut, unitcontextmenu.nut, + * slotactions.nut) hide the "Order" action and show a cross-promo locked banner instead of + * routing to the local store pack and bundle GUID generated for gift vehicles. Both parameters + * are stripped here so those vehicles can be ordered directly from the tech tree. */ import type { BlkBlock } from '@wto/blk'; export const SHOP_PATH = 'config/shop.blk'; const HIDING_FLAGS = new Set(['showOnlyWhenResearch', 'showOnlyWhenAvailableForPurchase']); +const CROSS_PROMO_PARAMS = new Set(['isCrossPromo', 'crossPromoBanner']); -/** Remove the hiding flags in place; returns how many vehicles were hidden before. */ +/** + * Remove tech-tree hiding flags and cross-promo lock parameters in place. + * Returns how many vehicles had a hiding flag removed (cross-promo unlocks are not counted). + */ export function revealHiddenVehicles(shop: BlkBlock): number { let revealed = 0; for (const entry of shopEntries(shop)) { - const kept = entry.params.filter((param) => !HIDING_FLAGS.has(param.name)); - if (kept.length === entry.params.length) continue; + let wasHidden = false; + let stripped = false; + const kept = entry.params.filter((param) => { + if (HIDING_FLAGS.has(param.name)) { + wasHidden = true; + stripped = true; + return false; + } + if (CROSS_PROMO_PARAMS.has(param.name)) { + stripped = true; + return false; + } + return true; + }); + if (!stripped) continue; entry.params = kept; - revealed++; + if (wasHidden) revealed++; } return revealed; }