Skip to content

Commit

Permalink
Merge pull request OpenRA#13219 from GraionDilach/fix-rangemodifier-r…
Browse files Browse the repository at this point in the history
…egression

Fix RangeMultiplier regression.
  • Loading branch information
atlimit8 authored May 5, 2017
2 parents ea29cce + c48cf51 commit 4ec0089
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions OpenRA.Mods.Common/Traits/Multipliers/RangeMultiplier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
namespace OpenRA.Mods.Common.Traits
{
[Desc("Modifies the range of weapons fired by this actor.")]
public class RangeMultiplierInfo : ConditionalTraitInfo
public class RangeMultiplierInfo : ConditionalTraitInfo, IRangeModifierInfo
{
[FieldLoader.Require]
[Desc("Percentage modifier to apply.")]
public readonly int Modifier = 100;

public override object Create(ActorInitializer init) { return new RangeMultiplier(this); }

int IRangeModifierInfo.GetRangeModifierDefault() { return EnabledByDefault ? Modifier : 100; }
}

public class RangeMultiplier : ConditionalTrait<RangeMultiplierInfo>, IRangeModifierInfo
public class RangeMultiplier : ConditionalTrait<RangeMultiplierInfo>, IRangeModifier
{
public RangeMultiplier(RangeMultiplierInfo info)
: base(info) { }

int IRangeModifierInfo.GetRangeModifierDefault() { return IsTraitDisabled ? 100 : Info.Modifier; }
int IRangeModifier.GetRangeModifier() { return IsTraitDisabled ? 100 : Info.Modifier; }
}
}

0 comments on commit 4ec0089

Please sign in to comment.