fix ore/tib growth -- we can always grow in a cell that already contains our resource type. buildable/terraintype checks only come into it when growing into *new* cells

This commit is contained in:
Chris Forbes
2010-10-25 11:28:52 +13:00
parent 814c6a8713
commit b80962b365

View File

@@ -49,9 +49,9 @@ namespace OpenRA.Mods.RA
.Cast<int2?>().FirstOrDefault();
// Todo: Valid terrain should be specified in the resource
if (cell != null &&
(resLayer.GetResource(cell.Value) == resourceType || resLayer.GetResource(cell.Value) == null) &&
self.World.IsCellBuildable(cell.Value, false))
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.AddResource(resourceType, cell.Value.X, cell.Value.Y, 1);
ticks = info.Interval;