From 0fccea55b8afbcfe7f39e849f9e57239fd30cdbd Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 17:51:44 -0500 Subject: [PATCH] fix(entity): proximity and pathfinding from a script only when the client makes the script The client's script allocator adds them only for a script component it makes (a registry script with a non-zero id, or a custom script in the config it is sent). Characters and the registry-id-0 script LOTs no longer get them. Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 1a45b73ee..8d7bf5b4d 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -488,7 +488,12 @@ void Entity::DoObjectComponentLoad(ObjectLoadState& state) { const bool hasCustomScript = !GetVarAsString(u"custom_script_server").empty() || !GetVarAsString(u"custom_script_client").empty(); if (scriptComponentID >= 0 || m_Character || hasCustomScript) { AddComponent(scriptComponentID); - addProximityAndPathfinding(); + // The client's script allocator adds these only when it makes a script component: a registry script with a + // non-zero id or a custom script in the config it is sent (a character's script is the server's own) + const auto clientCustomScript = [this](const std::u16string& key) { return IsVarSentToClient(key) && !GetVarAsString(key).empty(); }; + if (scriptComponentID > 0 || (m_TemplateID != 176 && (clientCustomScript(u"custom_script_server") || clientCustomScript(u"custom_script_client")))) { + addProximityAndPathfinding(); + } } // ZoneControl script