From 9196dc2a4d274d77fc9169a4288bf74081183e12 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:34:31 +0800 Subject: [PATCH] fix(economy): wrap vehicle prices in the Common block Use the block expected by the client to fix zero vehicle prices. Document hangar settings, modification state, and price table paths. --- .../local-service/src/research/price-table.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/local-service/src/research/price-table.ts b/packages/local-service/src/research/price-table.ts index 7c6ffdb..d69b923 100644 --- a/packages/local-service/src/research/price-table.ts +++ b/packages/local-service/src/research/price-table.ts @@ -3,18 +3,24 @@ * * The client keeps the answer whole as its price table (aces.exe 2.61.0.37 0xeb7a88, job type * 0x21; stored in the save-data object at +0x3f5c0, which warpoints::init makes the price - * source, 0x105bb4d..0x105bb67). wp_get_cost / wp_get_cost_gold (0x10514f0 / 0x1051900) look - * a vehicle up under aircrafts/ (0x908a20) and read + * source, 0x105bb4d..0x105bb67). Every price reader goes through one lookup (0x908a20 -> + * 0x908d10): it first takes a top-level block named after a client-side string (default + * "English"), else the top-level block "Common", else finds nothing; the path is looked up + * inside that block. So the whole table sits in Common. wp_get_cost / wp_get_cost_gold + * (0x10514f0 / 0x1051900) use the path aircrafts/ and read * cost:i silver lions * costGold:i golden eagles * discount:i percent off (not sent: no discounts) - * A vehicle missing from the table costs 0 for the client, which then offers it at 0 (lab + * A vehicle the lookup does not find costs 0 for the client, which then offers it at 0 (lab * round 20). The prices are config/wpcost.blk value and costGold, the same the purchase rule * charges (vehicle-purchase.ts). */ import type { BlkBlock } from '@wto/blk'; import type { TechTree } from './tech-tree.ts'; +/** The top-level block every client lookup falls back to (0x908e28). */ +const COMMON_SECTION = 'Common'; + export function priceTable(techTree: TechTree): BlkBlock { const vehicles: BlkBlock[] = []; for (const vehicle of techTree.all()) { @@ -28,5 +34,6 @@ export function priceTable(techTree: TechTree): BlkBlock { blocks: [], }); } - return { name: '', params: [], blocks: [{ name: 'aircrafts', params: [], blocks: vehicles }] }; + const common: BlkBlock = { name: COMMON_SECTION, params: [], blocks: [{ name: 'aircrafts', params: [], blocks: vehicles }] }; + return { name: '', params: [], blocks: [common] }; }