From: xangelo Date: Thu, 2 Jun 2022 17:52:46 +0000 (-0400) Subject: display error when cant build something X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=4e6a9902eb6f57e35e06a03d1e0fa7ba781f8992;p=browser-rts.git display error when cant build something --- diff --git a/src/render/land-development.ts b/src/render/land-development.ts index 0c1fad9..9cd4eb7 100644 --- a/src/render/land-development.ts +++ b/src/render/land-development.ts @@ -32,8 +32,8 @@ export function renderLandDevelopment(city: CityWithLocation, buildings: Buildin ${building.display} ${city[building.slug]} -
- + +
diff --git a/src/render/unit-training.ts b/src/render/unit-training.ts index a177dec..5742d94 100644 --- a/src/render/unit-training.ts +++ b/src/render/unit-training.ts @@ -30,8 +30,8 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini Soldiers ${city.soldiers} -
- + +
@@ -42,8 +42,8 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini Attackers ${city.attackers} -
- + +
@@ -54,8 +54,8 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini Defenders ${city.defenders} -
- + +
@@ -66,8 +66,8 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini Special Attackers ${city.sp_attackers} -
- + +
@@ -79,8 +79,8 @@ export function renderUnitTraining(city: CityWithLocation, units: Unit[], traini Special Defenders ${city.sp_defenders} -
- + +
diff --git a/src/repository/city.ts b/src/repository/city.ts index 272ee3b..a17d1d9 100644 --- a/src/repository/city.ts +++ b/src/repository/city.ts @@ -206,7 +206,7 @@ where l.sector_id = ?`, [sector_id]); // validate that they have enough empty construction queues const concurrentConstruction = await this.buildQueue.list(city.owner); if(concurrentConstruction.length >= city.max_construction_queue) { - throw new InsufficientResourceError('Training queues', concurrentConstruction.length + 1, city.max_construction_queue); + throw new InsufficientResourceError('Construction queues', concurrentConstruction.length + 1, city.max_construction_queue); } city.usedSpace += (building.land * amount);