Skip to content

Commit

Permalink
Merge pull request #10 from ntut-Tu/merge
Browse files Browse the repository at this point in the history
AI unit spawn fix
  • Loading branch information
ntut-Tu authored Jun 14, 2024
2 parents 7fc60c3 + d77e25f commit 62ab91e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AI/AIScripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(m_paid)) {
spawnUnit();
}
return;
Expand Down

0 comments on commit 62ab91e

Please sign in to comment.