diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj
index 214139a8d3..3c9e1d3282 100755
--- a/OpenRA.Game/OpenRA.Game.csproj
+++ b/OpenRA.Game/OpenRA.Game.csproj
@@ -218,7 +218,6 @@
-
diff --git a/OpenRA.Game/Traits/Mobile.cs b/OpenRA.Game/Traits/Mobile.cs
index 44fe25c709..5384bb5f78 100644
--- a/OpenRA.Game/Traits/Mobile.cs
+++ b/OpenRA.Game/Traits/Mobile.cs
@@ -215,10 +215,7 @@ namespace OpenRA.Traits
return float.PositiveInfinity;
var type = self.World.GetTerrainType(cell);
- var additionalCost = self.World.WorldActor.traits.WithInterface()
- .Select( t => t.GetTerrainCost(cell, self) ).Sum();
-
- return TerrainCost[type] + additionalCost;
+ return TerrainCost[type];
}
public virtual float MovementSpeedForCell(Actor self, int2 cell)
diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs
index 6aa1c1c8ba..9ae96f8f76 100644
--- a/OpenRA.Game/Traits/TraitsInterfaces.cs
+++ b/OpenRA.Game/Traits/TraitsInterfaces.cs
@@ -45,12 +45,8 @@ namespace OpenRA.Traits
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
public interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); }
public interface INotifyEnterCell { void OnEnterCell(Actor self, int2 cell); }
- public interface IProvideHazard { IEnumerable HazardCells(Actor self); }
- public interface IAvoidHazard { string Type { get; } }
public interface IStoreOre { int Capacity { get; }}
- public interface ITerrainCost { float GetTerrainCost(int2 cell, Actor forActor); }
-
public interface IDisable { bool Disabled { get; } }
public interface IExplodeModifier { bool ShouldExplode(Actor self); }
public interface INudge { void OnNudge(Actor self, Actor nudger); }
diff --git a/OpenRA.Game/Traits/World/HazardLayer.cs b/OpenRA.Game/Traits/World/HazardLayer.cs
deleted file mode 100644
index 7f2c6dae4e..0000000000
--- a/OpenRA.Game/Traits/World/HazardLayer.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-#region Copyright & License Information
-/*
- * Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
- * This file is part of OpenRA, which is free software. It is made
- * available to you under the terms of the GNU General Public License
- * as published by the Free Software Foundation. For more information,
- * see LICENSE.
- */
-#endregion
-
-using System.Collections.Generic;
-using System.Linq;
-using OpenRA.FileFormats;
-
-namespace OpenRA.Traits
-{
- public class HazardLayerInfo : ITraitInfo
- {
- public object Create( ActorInitializer init ) { return new HazardLayer( init.world ); }
- }
-
- public class HazardLayer : ITerrainCost
- {
- List>[,] hazards;
-
- public HazardLayer( World world )
- {
- hazards = new List>[world.Map.MapSize.X, world.Map.MapSize.Y];
- for (int i = 0; i < world.Map.MapSize.X; i++)
- for (int j = 0; j < world.Map.MapSize.Y; j++)
- hazards[ i, j ] = new List>();
-
- world.ActorRemoved += a => Remove( a, a.traits.GetOrDefault() );
- }
-
- public float GetTerrainCost(int2 p, Actor forActor)
- {
- var avoid = forActor.traits.WithInterface().Select(h => h.Type).ToList();
-
- var intensity = hazards[p.X,p.Y].Where(a => avoid.Contains(a.Second.type))
- .Select(b => b.Second.intensity)
- .Sum();
-
- return intensity;
- }
-
- public void Add( Actor self, IProvideHazard hazard )
- {
- foreach( var h in hazard.HazardCells(self) )
- {
- hazards[h.location.X, h.location.Y].Add(Pair.New(self, h));
- }
- }
-
- public void Remove( Actor self, IProvideHazard hazard )
- {
- if (hazard != null)
- foreach (var h in hazard.HazardCells(self))
- hazards[h.location.X, h.location.Y].Remove(Pair.New(self,h));
- }
-
- public void Update(Actor self, IProvideHazard hazard)
- {
- Remove(self, hazard);
- if (!self.IsDead) Add(self, hazard);
- }
-
- public struct Hazard
- {
- public int2 location;
- public string type;
- public float intensity;
- }
- }
-}
diff --git a/OpenRA.Mods.Cnc/MobileAir.cs b/OpenRA.Mods.Cnc/MobileAir.cs
index 15c97ed8be..4deaa521d1 100644
--- a/OpenRA.Mods.Cnc/MobileAir.cs
+++ b/OpenRA.Mods.Cnc/MobileAir.cs
@@ -54,13 +54,7 @@ namespace OpenRA.Traits
public override float MovementCostForCell(Actor self, int2 cell)
{
- if (!self.World.Map.IsInMap(cell.X,cell.Y))
- return float.PositiveInfinity;
-
- var additionalCost = self.World.WorldActor.traits.WithInterface()
- .Select( t => t.GetTerrainCost(cell, self) ).Sum();
-
- return additionalCost;
+ return (!self.World.Map.IsInMap(cell.X,cell.Y)) ? float.PositiveInfinity : 0;
}
public override float MovementSpeedForCell(Actor self, int2 cell)
diff --git a/OpenRA.Mods.RA/Hazardous.cs b/OpenRA.Mods.RA/Hazardous.cs
deleted file mode 100755
index 4bffd68d9e..0000000000
--- a/OpenRA.Mods.RA/Hazardous.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-#region Copyright & License Information
-/*
- * Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
- * This file is part of OpenRA, which is free software. It is made
- * available to you under the terms of the GNU General Public License
- * as published by the Free Software Foundation. For more information,
- * see LICENSE.
- */
-#endregion
-
-using System.Collections.Generic;
-using System.Linq;
-using OpenRA.Traits;
-
-namespace OpenRA.Mods.RA
-{
- class AntiAirInfo : ITraitInfo
- {
- public readonly float Badness = 1000f;
- public object Create( ActorInitializer init ) { return new AntiAir( init.self ); }
- }
-
- class AntiAir : IProvideHazard
- {
- public AntiAir(Actor self)
- {
- self.World.WorldActor.traits.Get().Add( self, this );
- }
-
- public IEnumerable HazardCells(Actor self)
- {
- var info = self.Info.Traits.Get();
- return self.World.FindTilesInCircle(self.Location, (int)self.GetPrimaryWeapon().Range).Select(
- t => new HazardLayer.Hazard(){location = t, type = "antiair", intensity = info.Badness});
- }
- }
-
- class AvoidsAAInfo : TraitInfo {}
- class AvoidsAA : IAvoidHazard
- {
- public string Type { get { return "antiair"; } }
- }
-}
diff --git a/OpenRA.Mods.RA/Mine.cs b/OpenRA.Mods.RA/Mine.cs
index fe3c58983b..10f80f03d5 100644
--- a/OpenRA.Mods.RA/Mine.cs
+++ b/OpenRA.Mods.RA/Mine.cs
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA
self.QueueActivity(new RemoveSelf());
}
- // TODO: Re-implement friendly-mine avoidance using a Hazard
+ // TODO: Re-implement friendly-mine avoidance
public IEnumerable CrushClasses { get { return info.CrushClasses; } }
public int2 TopLeft { get { return location; } }
diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
index c7c44ad9f4..9a3f1f057a 100644
--- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
+++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
@@ -88,7 +88,6 @@
-