diff --git a/olcCodeJam2023Entry/Scenario.cpp b/olcCodeJam2023Entry/Scenario.cpp index 872653c..8abc5dc 100644 --- a/olcCodeJam2023Entry/Scenario.cpp +++ b/olcCodeJam2023Entry/Scenario.cpp @@ -45,6 +45,7 @@ void Scenario::RunAI(Resources&enemy_resources,std::vectorGetElapsedTime()); unitBuildTimer=std::max(0.f,unitBuildTimer-game.GetPGE()->GetElapsedTime()); diff --git a/olcCodeJam2023Entry/Unit.cpp b/olcCodeJam2023Entry/Unit.cpp index 4f080dc..8700cd6 100644 --- a/olcCodeJam2023Entry/Unit.cpp +++ b/olcCodeJam2023Entry/Unit.cpp @@ -960,7 +960,7 @@ void Unit::_Attacked(std::weak_ptrattacker,std::vectorIsFriendly()&&!attacker.lock()->CanInteractWithAllies()){ attacker.lock()->SetTargetLocation(attacker.lock()->GetPos()); //This effectively negates enemies targeting each other for attacking if they're not supposed to. Somehow this occurs sometimes. } - if(attacker.lock()->IsFriendly()!=IsFriendly()){ + if(!IsFriendly()&&attacker.lock()->IsFriendly()!=IsFriendly()){ for(auto&u:otherUnits){ if(this!=u.get()&&!u->IsFriendly()&&u->GetCurrentTarget().expired()&&u->CanMove()&&!u->IsAllocator()){ geom2d::linedistLine={GetPos(),u->GetPos()}; diff --git a/olcCodeJam2023Entry/pge.wasm b/olcCodeJam2023Entry/pge.wasm index 77cc4e8..1fe0a84 100644 Binary files a/olcCodeJam2023Entry/pge.wasm and b/olcCodeJam2023Entry/pge.wasm differ