fix market capacity
This commit is contained in:
@@ -75,6 +75,7 @@ function gatherState() {
|
||||
|
||||
// ---- Market / Trade capacity -----------------------------------------
|
||||
let marketCapacity = 0;
|
||||
let availableTradeCapacity = 0;
|
||||
try {
|
||||
const marketLevel = buildings.market ?? 0;
|
||||
const gd = uw.GameData?.buildingData?.market;
|
||||
@@ -82,6 +83,7 @@ function gatherState() {
|
||||
if (buildings.trade_office && buildings.trade_office > 0) {
|
||||
marketCapacity += (uw.GameData?.buildingData?.trade_office?.capacity_extra_per_level || 500) * marketLevel;
|
||||
}
|
||||
availableTradeCapacity = town.getAvailableTradeCapacity?.() ?? marketCapacity;
|
||||
} catch (e) { log(`market capacity lookup failed: ${e}`); }
|
||||
|
||||
// ---- Coordinates & sea zone -----------------------------------------
|
||||
@@ -176,6 +178,7 @@ function gatherState() {
|
||||
iron: res.iron,
|
||||
storage: storageCapacity,
|
||||
market_capacity: marketCapacity,
|
||||
available_trade_capacity: availableTradeCapacity,
|
||||
population: res.population,
|
||||
points: town.getPoints?.() ?? 0,
|
||||
god: town.god?.() ?? null,
|
||||
|
||||
Reference in New Issue
Block a user