From 082a2a418f345c6c39ff6bca4f8ac60e39e0285f Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Tue, 19 Jul 2022 23:25:50 -0700 Subject: [PATCH] Use radii from settings Override the DB aggro and tether radii from the settings if they are present. --- dGame/dComponents/BaseCombatAIComponent.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dGame/dComponents/BaseCombatAIComponent.cpp b/dGame/dComponents/BaseCombatAIComponent.cpp index 0903e621..4623e4dd 100644 --- a/dGame/dComponents/BaseCombatAIComponent.cpp +++ b/dGame/dComponents/BaseCombatAIComponent.cpp @@ -61,6 +61,15 @@ BaseCombatAIComponent::BaseCombatAIComponent(Entity* parent, const uint32_t id) 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(u"aggroRadius"); + m_AggroRadius = std::max(aggroRadius, m_AggroRadius); + auto tetherRadius = m_Parent->GetVar(u"tetherRadius"); + m_HardTetherRadius = std::max(tetherRadius, m_HardTetherRadius); + } + /* * Find skills */