1
0
forked from mirrors/0ad

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
This commit is contained in:
Atrik
2026-01-16 05:54:46 +01:00
committed by Vantha
parent 8129b8ffc1
commit 68e625ab7a
@@ -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;