We shouldn't mess with allocators that already are trying to collect resources.

master
sigonasr2 1 year ago
parent 07c1a841d4
commit 8b17d9bcbd
  1. 2
      olcCodeJam2023Entry/Scenario.cpp
  2. BIN
      olcCodeJam2023Entry/pge.wasm

@ -112,7 +112,7 @@ void Scenario::RunAI(Resources&enemy_resources,std::vector<std::shared_ptr<Colle
//Randomly turn memory allocators into other units. //Randomly turn memory allocators into other units.
if(unitBuildTimer==0){ if(unitBuildTimer==0){
for(auto&u:units){ for(auto&u:units){
if(!u->IsFriendly()&&u->IsAllocator()){ if(!u->IsFriendly()&&u->IsAllocator()&&u->attachTarget.expired()){
std::array<UnitType,10>unitChoiceList={UnitType::LeftShifter,UnitType::LeftShifter,UnitType::RightShifter,UnitType::RightShifter, std::array<UnitType,10>unitChoiceList={UnitType::LeftShifter,UnitType::LeftShifter,UnitType::RightShifter,UnitType::RightShifter,
UnitType::Corrupter,UnitType::MemorySwapper,UnitType::BitRestorer,UnitType::BitRestorer,UnitType::_Platform,UnitType::Corrupter}; UnitType::Corrupter,UnitType::MemorySwapper,UnitType::BitRestorer,UnitType::BitRestorer,UnitType::_Platform,UnitType::Corrupter};
std::array<std::vector<Memory>,10>unitResourceCostList={LeftShifter::resourceCost,LeftShifter::resourceCost,RightShifter::resourceCost,RightShifter::resourceCost, std::array<std::vector<Memory>,10>unitResourceCostList={LeftShifter::resourceCost,LeftShifter::resourceCost,RightShifter::resourceCost,RightShifter::resourceCost,

Binary file not shown.
Loading…
Cancel
Save