From e86eea383a6f76a552d5bcac8dc00138f90cdcb4 Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Sat, 26 Sep 2015 11:12:39 -0500 Subject: [PATCH] SpreadDamageWarhead.Range loading --- OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs index c63077583b..94dd11d8e6 100644 --- a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs @@ -10,12 +10,13 @@ using System; using System.Collections.Generic; +using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Warheads { - public class SpreadDamageWarhead : DamageWarhead + public class SpreadDamageWarhead : DamageWarhead, IRulesetLoaded { [Desc("Range between falloff steps.")] public readonly WDist Spread = new WDist(43); @@ -29,7 +30,7 @@ namespace OpenRA.Mods.Common.Warheads [Desc("Ranges at which each Falloff step is defined. Overrides Spread.")] public WDist[] Range = null; - public void InitializeRange() + public void RulesetLoaded(Ruleset rules, WeaponInfo info) { if (Range != null) { @@ -46,9 +47,6 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(WPos pos, Actor firedBy, IEnumerable damageModifiers) { - if (Range == null) - InitializeRange(); - var world = firedBy.World; if (world.LocalPlayer != null)