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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user