bullets can destroy ore (based on WarheadInfo.Ore)

This commit is contained in:
Chris Forbes
2009-12-05 16:11:54 +13:00
parent 6b5f0cebf5
commit 0863ca5df2
2 changed files with 12 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ namespace OpenRa.Game
Smudge.AddSmudge(false, targetTile.X, targetTile.Y);
break;
}
if (Warhead.Ore)
Ore.Destroy(targetTile.X, targetTile.Y);
});
var maxSpread = GetMaximumSpread();

View File

@@ -17,6 +17,15 @@ namespace OpenRa.Game
}
}
public static void Destroy(int i, int j)
{
if (Rules.Map.ContainsResource(new int2(i, j)))
{
Rules.Map.MapTiles[i, j].density = 0;
Rules.Map.MapTiles[i, j].overlay = 0xff;
}
}
public static bool CanSpreadInto(int i, int j)
{
if (Game.BuildingInfluence.GetBuildingAt(new int2(i, j)) != null)