add support for WeaponInfo.MinRange
This commit is contained in:
@@ -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<WarheadInfo> Warheads;
|
||||
|
||||
@@ -124,6 +124,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;
|
||||
|
||||
var barrel = w.Barrels[w.Burst % w.Barrels.Length];
|
||||
|
||||
Reference in New Issue
Block a user