From d77e25f705adabf0e96fb58aec5882eafae45a94 Mon Sep 17 00:00:00 2001 From: quinndu0 <160988691+ntut-Tu@users.noreply.github.com> Date: Fri, 14 Jun 2024 20:33:46 +0800 Subject: [PATCH] AI unit spawn fix --- src/AI/AIScripts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AI/AIScripts.cpp b/src/AI/AIScripts.cpp index 4633008..f2d7de3 100644 --- a/src/AI/AIScripts.cpp +++ b/src/AI/AIScripts.cpp @@ -131,8 +131,8 @@ void AIScript::setCost(float cost, SpawnMode spawnMode) { void AIScript::buildBasic() { if (m_selectedBuildingType != UnitType::NONE) { - if (m_selectedBuildingType != UnitType::ORE_REF && - m_EnemyObjectManager->getTotalCurrency() > 2000 + 100 - m_paid) { + if (m_selectedBuildingType == UnitType::ORE_REF && + m_EnemyObjectManager->getTotalCurrency() > 2000 + 100 + static_cast(m_paid)) { spawnUnit(); } return;