Refactored monster list to use shared pointers instead of unique pointers. Converted all raw monster pointers that needed to store monster data to use weak pointers instead in case a monster gets despawned while owning object is still alive. Implemented Witch's auto attack, added turn_towards_direction function for homing ability. Fixed player reflections being drawn without additive blending. Added 30s cooldown to Trapper's Explosive trap ability. Release Build 10345.
if(MONSTER_LIST.capacity()>prevCapacity)LOG(std::format("WARNING! The monster list has automatically reserved more space and resized to {}! This caused one potential frame where bullet/effect hitlists that stored information on what monsters were hit to potentially be hit a second time or cause monsters that should've been hit to never be hit. Consider starting with a larger default reserved size for MONSTER_LIST if your intention was to have this many monsters!",MONSTER_LIST.capacity()));
if(m->markedForDeletion)std::erase_if(lockOnTargets,[&](std::tuple<Monster*,StackCount,MarkTime>markData){returnstd::get<0>(markData)==&*m;});//Marked targets may have dangling pointers, remove them before removing the monsters for good.
//Runs the Hawk strategy and has an aggressive mode when the amount of this monster falls below an amount.
constintmajorHawkCount=std::accumulate(MONSTER_LIST.begin(),MONSTER_LIST.end(),0,[&](constint&acc,conststd::unique_ptr<Monster>&monster){returnstd::move(acc)+((monster->IsAlive()&&monster->GetName()==ConfigString("Aggressive Name Check"))?1:0);});
constintmajorHawkCount=std::accumulate(MONSTER_LIST.begin(),MONSTER_LIST.end(),0,[&](constint&acc,conststd::shared_ptr<Monster>&monster){returnstd::move(acc)+((monster->IsAlive()&&monster->GetName()==ConfigString("Aggressive Name Check"))?1:0);});
//NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!!
// The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop.
//Modifies angle argument directly to turn towards said direction. rate is in radians, please multiply by fElapsedTime if you intend to use this per frame.