From 68e625ab7acdb85551d22476e19c1899d6f49b91 Mon Sep 17 00:00:00 2001 From: Atrik Date: Fri, 16 Jan 2026 05:54:46 +0100 Subject: [PATCH] Fix errors if promoted units change attack range While in combat, if units are promoted and the promotion results in a change in their attack range, this could trigger some errors as 'this.template[type]' had a chance to be undefined when performing a 'RepeatRangeCheck'. Fixes #8670 --- binaries/data/mods/public/simulation/components/Attack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/data/mods/public/simulation/components/Attack.js b/binaries/data/mods/public/simulation/components/Attack.js index 9f9ae91909..75c42e9ebb 100644 --- a/binaries/data/mods/public/simulation/components/Attack.js +++ b/binaries/data/mods/public/simulation/components/Attack.js @@ -451,7 +451,7 @@ Attack.prototype.GetSplashData = function(type) Attack.prototype.GetRange = function(type) { - if (!type) + if (!type || !this.template[type]) return this.GetFullAttackRange(); let max = +this.template[type].MaxRange;