diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index 645261fd2f..9b19e66aa9 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -93,6 +93,7 @@ namespace OpenRA.GameRules [FieldLoader.Load] public readonly bool Underwater = false; [FieldLoader.Load] public readonly string[] ValidTargets = { "Ground" }; [FieldLoader.Load] public readonly int BurstDelay = 5; + [FieldLoader.Load] public readonly float MinRange = 0; [FieldLoader.LoadUsing( "LoadProjectile" )] public IProjectileInfo Projectile; [FieldLoader.LoadUsing( "LoadWarheads" )] public List Warheads; diff --git a/OpenRA.Mods.RA/AttackBase.cs b/OpenRA.Mods.RA/AttackBase.cs index d1901b003e..b57959ae76 100644 --- a/OpenRA.Mods.RA/AttackBase.cs +++ b/OpenRA.Mods.RA/AttackBase.cs @@ -123,6 +123,9 @@ namespace OpenRA.Mods.RA if (w.Info.Range * w.Info.Range * Game.CellSize * Game.CellSize < (target.CenterLocation - self.CenterLocation).LengthSquared) return false; + + if (w.Info.MinRange * w.Info.MinRange * Game.CellSize * Game.CellSize > + (target.CenterLocation - self.CenterLocation).LengthSquared) return false; if (!w.IsValidAgainst(target)) return false;