From 5d7772ac9a653e6eab13385fc7c2680eecb38398 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 3 Mar 2010 21:00:23 +1300 Subject: [PATCH] DestroyOre ported --- OpenRA.Game/Combat.cs | 3 ++- OpenRA.Game/Ore.cs | 13 ++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/OpenRA.Game/Combat.cs b/OpenRA.Game/Combat.cs index b5ac5513cc..c2fa65ca42 100644 --- a/OpenRA.Game/Combat.cs +++ b/OpenRA.Game/Combat.cs @@ -48,7 +48,8 @@ namespace OpenRA if (impactSound != null) Sound.Play(impactSound + ".aud"); if (!isWater) world.Map.AddSmudge(targetTile, warhead); - if (warhead.Ore) world.Map.DestroyOre(targetTile.X, targetTile.Y); + if (warhead.Ore) + world.WorldActor.traits.Get().Destroy(targetTile); var firepowerModifier = firedBy.traits .WithInterface() diff --git a/OpenRA.Game/Ore.cs b/OpenRA.Game/Ore.cs index 01ee46eb3b..b7e2fb0942 100644 --- a/OpenRA.Game/Ore.cs +++ b/OpenRA.Game/Ore.cs @@ -26,15 +26,6 @@ namespace OpenRA { public static class Ore { - public static void DestroyOre(this Map map, int i, int j) - { - //if (map.ContainsResource(new int2(i, j))) - //{ - // map.MapTiles[i, j].density = 0; - // map.MapTiles[i, j].overlay = 0xff; - //} - } - public static void SpreadOre(this World world, Random r, float chance) { var map = world.Map; @@ -99,7 +90,7 @@ namespace OpenRA return ore; } - public static bool[] overlayIsOre = + static bool[] overlayIsOre = { false, false, false, false, false, true, true, true, true, @@ -108,7 +99,7 @@ namespace OpenRA false, false, false, false, false, }; - public static bool[] overlayIsGems = + static bool[] overlayIsGems = { false, false, false, false, false, false, false, false, false,