From a1411fc182f1d18afeb20c9293a2ab3bbb4537d4 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Thu, 25 Jan 2024 22:47:16 -0800 Subject: [PATCH] Hide disabled weapons on range overlay Revert "Hide disabled weapons on range overlay" This reverts commit fa3d50110cee4a5406db9334bb634b481dd1789c. Set weapon range to 0 when disabled --- lua/sim/weapon.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/sim/weapon.lua b/lua/sim/weapon.lua index 183f4bb907..64ed7253d1 100644 --- a/lua/sim/weapon.lua +++ b/lua/sim/weapon.lua @@ -682,15 +682,20 @@ Weapon = ClassWeapon(WeaponMethods) { SetWeaponEnabled = function(self, enable) if not IsDestroyed(self) then if not enable then + WeaponMethods.ChangeMaxRadius(self, 0) + WeaponMethods.ChangeMinRadius(self, 0) self:SetEnabled(enable) return end + local enabledByEnh = self.Blueprint.EnabledByEnhancement if enabledByEnh then local enhancements = SimUnitEnhancements[self.unit.EntityId] if enhancements then for _, enh in enhancements do if enh == enabledByEnh then + WeaponMethods.ChangeMaxRadius(self, self:GetMaxRadius()) + WeaponMethods.ChangeMinRadius(self, self:GetMinRadius()) self:SetEnabled(enable) return end @@ -699,6 +704,8 @@ Weapon = ClassWeapon(WeaponMethods) { -- enhancement needed, but doesn't have it; don't allow weapon to be enabled return end + WeaponMethods.ChangeMaxRadius(self, self:GetMaxRadius()) + WeaponMethods.ChangeMinRadius(self, self:GetMinRadius()) self:SetEnabled(enable) end end,