diff --git a/browser/lib/plunder/attack.ts b/browser/lib/plunder/attack.ts index e881d1d5..7b71e8a8 100644 --- a/browser/lib/plunder/attack.ts +++ b/browser/lib/plunder/attack.ts @@ -1,5 +1,5 @@ import { useEventListener, useMutationObserver } from '@vueuse/core'; -import { assertInteger, isInstanceOf, assertString, assert } from '@tb-dev/ts-guard'; +import { assertInteger, isInstanceOf, assertString } from '@tb-dev/ts-guard'; import { usePlunderConfigStore } from '$renderer/stores/plunder'; import { generateRandomDelay } from '$global/helpers'; import { wait } from '$browser/utils/helpers'; @@ -103,7 +103,10 @@ export async function sendAttackFromPlace(units: PlaceUnitsAmount): Promise { const neededUnits = demolitionTemplate.units[info.wallLevel.toString(10) as StringWallLevel]; // Verifica se há unidades o suficiente para destruir a muralha. + await queryAvailableUnits(); const unitStore = useUnitsStore(); for (const [key, value] of Object.entries(neededUnits) as [keyof DemolitionTroops, number][]) { if (unitStore[key] < value) return false;