From c898356eba5217933ba4e3173b8242461b3b24b2 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Tue, 16 Jun 2026 07:49:56 -0700 Subject: [PATCH] fix: enemies not interrupting QB's when they do damage (#1998) tested that stromlings in AG now correctly interrupt quickbuilds if the player takes damage --- dGame/dBehaviors/NpcCombatSkillBehavior.h | 2 ++ dGame/dBehaviors/VerifyBehavior.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dGame/dBehaviors/NpcCombatSkillBehavior.h b/dGame/dBehaviors/NpcCombatSkillBehavior.h index 07826f48..993aed76 100644 --- a/dGame/dBehaviors/NpcCombatSkillBehavior.h +++ b/dGame/dBehaviors/NpcCombatSkillBehavior.h @@ -8,6 +8,8 @@ public: float m_npcSkillTime; + float m_maxRange{}; + /* * Inherited */ diff --git a/dGame/dBehaviors/VerifyBehavior.cpp b/dGame/dBehaviors/VerifyBehavior.cpp index c7ede52f..ec4b27a8 100644 --- a/dGame/dBehaviors/VerifyBehavior.cpp +++ b/dGame/dBehaviors/VerifyBehavior.cpp @@ -25,7 +25,7 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitS const auto distance = Vector3::DistanceSquared(self->GetPosition(), entity->GetPosition()); - if (distance > this->m_range * this->m_range) { + if (distance > this->m_range) { success = false; } } else if (this->m_blockCheck) { @@ -57,4 +57,5 @@ void VerifyBehavior::Load() { this->m_action = GetAction("action"); this->m_range = GetFloat("range"); + this->m_range = this->m_range * this->m_range * 0.9f; // Range checks are slightly smaller than the actual range to account for client/server discrepancies }