Switch to storing unique pointers for the monsters list instead of objects. Added a source monster for frog tongues to remain attached to so they follow the monster that they originated from. Release Build 8734.
This commit is contained in:
@@ -93,10 +93,10 @@ void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){
|
||||
game->GetPlayer()->Knockback(playerDirVecNorm*ConfigFloat("Attack Knockback Amount"));
|
||||
}
|
||||
}
|
||||
for(Monster&otherM:MONSTER_LIST){
|
||||
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&geom2d::overlaps(attackCircle,otherM.Hitbox())){
|
||||
otherM.Knockup(ConfigFloat("Attack Knockup Duration"));
|
||||
vf2d monsterDirVecNorm=geom2d::line<float>(m.GetPos(),otherM.GetPos()).vector().norm();
|
||||
for(std::unique_ptr<Monster>&otherM:MONSTER_LIST){
|
||||
if(!otherM->AttackAvoided(m.GetZ())&&&m!=otherM.get()&&geom2d::overlaps(attackCircle,otherM->Hitbox())){
|
||||
otherM->Knockup(ConfigFloat("Attack Knockup Duration"));
|
||||
vf2d monsterDirVecNorm=geom2d::line<float>(m.GetPos(),otherM->GetPos()).vector().norm();
|
||||
game->GetPlayer()->Knockback(monsterDirVecNorm*ConfigFloat("Attack Knockback Amount"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user