From d013337c5eb824d40eb80d2e0beb22fedecced91 Mon Sep 17 00:00:00 2001 From: WoodyXP Date: Mon, 3 Jul 2023 19:06:40 +0200 Subject: [PATCH] Changed the function that it gets all the units with a specified range --- client/src/units/unitdatabase.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/units/unitdatabase.ts b/client/src/units/unitdatabase.ts index 0689fa91..38862c6c 100644 --- a/client/src/units/unitdatabase.ts +++ b/client/src/units/unitdatabase.ts @@ -37,12 +37,14 @@ export class UnitDatabase { /* Gets a specific blueprint by range */ getByRange(range: string) { + var unitswithrange = []; for (let unit in this.blueprints) { - if (this.blueprints[unit].range === range) - return this.blueprints[unit]; + if (this.blueprints[unit].range === range) { + unitswithrange.push(this.blueprints[unit]); + } } - return null; - } + return unitswithrange; + } /* Get all blueprints by role */ getByRole(role: string) {