Skip to content

Commit

Permalink
Merge pull request #98 from ntut-Tu/main
Browse files Browse the repository at this point in the history
AI Unit Spawn fix
  • Loading branch information
jonylu7 authored Jun 14, 2024
2 parents 100f177 + 62ab91e commit 99d7adf
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 99d7adf

Please sign in to comment.