diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index cce3d4cbc5..fbeba21bdb 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -71,7 +71,7 @@ namespace OpenRA.Traits for (int y = map.YOffset; y < map.YOffset + map.Height; y++) { // Todo: Valid terrain should be specified in the resource - if (!AllowOreAt(new int2(x,y))) + if (!AllowResourceAt(new int2(x,y))) continue; content[x, y].type = resourceTypes.FirstOrDefault( @@ -89,7 +89,7 @@ namespace OpenRA.Traits } } - bool AllowOreAt( int2 a ) + public bool AllowResourceAt( int2 a ) { if( !world.Map.IsInMap( a.X, a.Y ) ) return false; if( !world.GetTerrainInfo( a ).Buildable ) return false; diff --git a/OpenRA.Mods.RA/SeedsResource.cs b/OpenRA.Mods.RA/SeedsResource.cs index ac93a96837..06cc07a67d 100644 --- a/OpenRA.Mods.RA/SeedsResource.cs +++ b/OpenRA.Mods.RA/SeedsResource.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Render; using OpenRA.Traits; @@ -52,7 +51,7 @@ namespace OpenRA.Mods.RA // Todo: Valid terrain should be specified in the resource if (cell != null && self.World.Map.IsInMap(cell.Value) && (resLayer.GetResource(cell.Value) == resourceType - || (resLayer.GetResource(cell.Value) == null && self.World.IsCellBuildable(cell.Value, false)))) + || (resLayer.GetResource(cell.Value) == null && resLayer.AllowResourceAt(cell.Value)))) resLayer.AddResource(resourceType, cell.Value.X, cell.Value.Y, 1); ticks = info.Interval;