diff --git a/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs index c16941c270..e44a33f649 100644 --- a/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs @@ -45,6 +45,10 @@ namespace OpenRA.Mods.Common.Warheads var firedBy = args.SourceActor; var pos = target.CenterPosition; var world = firedBy.World; + var dat = world.Map.DistanceAboveTerrain(pos); + if (dat > AirThreshold) + return; + var targetTile = world.Map.CellContaining(pos); var minRange = (Size.Length > 1 && Size[1] > 0) ? Size[1] : 0; diff --git a/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs b/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs index a505434e2e..9856cff5a0 100644 --- a/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs @@ -30,6 +30,10 @@ namespace OpenRA.Mods.Common.Warheads var firedBy = args.SourceActor; var pos = target.CenterPosition; var world = firedBy.World; + var dat = world.Map.DistanceAboveTerrain(pos); + if (dat > AirThreshold) + return; + var targetTile = world.Map.CellContaining(pos); var resLayer = world.WorldActor.Trait();