Merge pull request #661 from EmosewaMC/bons-fixes

Use Aggro and Tether radii settings from Entity Settings
This commit is contained in:
Jett 2022-07-20 10:10:57 +01:00 committed by GitHub
commit 91f2cebcc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,15 @@ BaseCombatAIComponent::BaseCombatAIComponent(Entity* parent, const uint32_t id)
componentResult.finalize(); componentResult.finalize();
// Get aggro and tether radius from settings and use this if it is present. Only overwrite the
// radii if it is greater than the one in the database.
if (m_Parent) {
auto aggroRadius = m_Parent->GetVar<float>(u"aggroRadius");
m_AggroRadius = std::max(aggroRadius, m_AggroRadius);
auto tetherRadius = m_Parent->GetVar<float>(u"tetherRadius");
m_HardTetherRadius = std::max(tetherRadius, m_HardTetherRadius);
}
/* /*
* Find skills * Find skills
*/ */