From d60e36c74a35d97d48d6e12ad6ed39dddfb88829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lancelot=20de=20Ferri=C3=A8re?= Date: Wed, 19 Aug 2026 11:27:48 +0200 Subject: [PATCH] Remove unused BuildingAI.CheckTargetVisible FireArrows now checks range/visibility via CanAttack directly (see next commit), leaving this method unused. --- .../simulation/components/BuildingAI.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/BuildingAI.js b/binaries/data/mods/public/simulation/components/BuildingAI.js index 8a2a7a594c..760f51f79d 100644 --- a/binaries/data/mods/public/simulation/components/BuildingAI.js +++ b/binaries/data/mods/public/simulation/components/BuildingAI.js @@ -405,23 +405,4 @@ BuildingAI.prototype.FireArrows = function() ++this.currentRound; }; -/** - * Returns true if the target entity is visible through the FoW/SoD. - */ -BuildingAI.prototype.CheckTargetVisible = function(target) -{ - var cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership); - if (!cmpOwnership) - return false; - - // Entities that are hidden and miraged are considered visible. - var cmpFogging = Engine.QueryInterface(target, IID_Fogging); - if (cmpFogging && cmpFogging.IsMiraged(cmpOwnership.GetOwner())) - return true; - - // Either visible directly, or visible in fog. - const cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); - return cmpRangeManager.GetLosVisibility(target, cmpOwnership.GetOwner()) != "hidden"; -}; - Engine.RegisterComponentType(IID_BuildingAI, "BuildingAI", BuildingAI);