Fix #8751 - IndexOutOfRangeException when UpgradeMultiplierTrait is pre-enabled

This commit is contained in:
atlimit8
2015-07-20 02:51:45 -05:00
parent 30696ea23d
commit 96cafccb8d

View File

@@ -45,6 +45,7 @@ namespace OpenRA.Mods.Common.Traits
throw new Exception("No modifiers in " + modifierType + " for " + actorType);
this.info = info;
IsTraitDisabled = info.UpgradeTypes.Length > 0 && info.BaseLevel > 0;
level = IsTraitDisabled ? 0 : info.BaseLevel;
}
public bool AcceptsUpgradeLevel(Actor self, string type, int level)