From ca3c6ee5feee1e10d23199df5b7535432ba7fd32 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 2 Apr 2010 11:40:51 +1300 Subject: [PATCH] damage stuff in any part of the cell; don't put smudge in water --- OpenRA.Game/Combat.cs | 5 +---- OpenRA.Game/Smudge.cs | 3 ++- mods/ra/weapons.yaml | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenRA.Game/Combat.cs b/OpenRA.Game/Combat.cs index 0bf322fe9d..e9e1e65e55 100644 --- a/OpenRA.Game/Combat.cs +++ b/OpenRA.Game/Combat.cs @@ -76,13 +76,10 @@ namespace OpenRA case DamageModel.PerCell: { foreach (var t in world.FindTilesInCircle(targetTile, warhead.SmudgeSize[0])) - { - var x = Util.CenterOfCell(t); - foreach (var unit in world.FindUnits(x, x)) + foreach (var unit in world.FindUnits(Game.CellSize * t, Game.CellSize * (t + new float2(1,1)))) unit.InflictDamage(args.firedBy, (int)(warhead.Damage * warhead.EffectivenessAgainst( unit.Info.Traits.Get().Armor)), warhead); - } } break; } } diff --git a/OpenRA.Game/Smudge.cs b/OpenRA.Game/Smudge.cs index 3b2cf24e2c..714305b22b 100644 --- a/OpenRA.Game/Smudge.cs +++ b/OpenRA.Game/Smudge.cs @@ -53,7 +53,8 @@ namespace OpenRA else foreach (var t in Game.world.FindTilesInCircle(targetTile, warhead.SmudgeSize[0])) if ((t - targetTile).LengthSquared >= warhead.SmudgeSize[1] * warhead.SmudgeSize[1]) - map.AddSmudge(warhead.SmudgeType == SmudgeType.Crater, t.X, t.Y); + if (Game.world.GetTerrainType(t) != TerrainType.Water) + map.AddSmudge(warhead.SmudgeType == SmudgeType.Crater, t.X, t.Y); } static int lastSmudge = 0; diff --git a/mods/ra/weapons.yaml b/mods/ra/weapons.yaml index bf14ed18c4..2ef75351fd 100644 --- a/mods/ra/weapons.yaml +++ b/mods/ra/weapons.yaml @@ -640,7 +640,6 @@ Atomic: Warhead@inner-nuke: DamageModel: PerCell Damage: 150 - SmudgeType: Scorch SmudgeSize: 3,2 Wall: true Wood: true