Fix clear condition not occuring because of out-of-bounds enemies.

master
sigonasr2 1 year ago
parent 4ec15f42a2
commit 822d52f92d
  1. 6
      olcCodeJam2023Entry/VirusAttack.cpp
  2. BIN
      olcCodeJam2023Entry/pge.wasm

@ -1258,6 +1258,12 @@ bool VirusAttack::OnUserUpdate(float fElapsedTime){
CalculateUsedMemory();
for(auto&u:units){
if(isnan(u->GetPos().x)||isnan(u->GetPos().y)){
for(int i=0;i<u->memory.size();i++){
u->memory[i]=false;
}
continue;//Unit does because it's out of bounds.
};
u->SaveMemory();
std::weak_ptr<Unit>closestUnit;
float closestDist=999999;

Binary file not shown.
Loading…
Cancel
Save