don't try to spawn resources when the cell is already full

fixes #5699
This commit is contained in:
Matthias Mailänder
2014-06-22 11:49:40 +02:00
parent 69ddcf3fee
commit 05609399eb
2 changed files with 4 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.RA
var cell = RandomWalk(self.Location, self.World.SharedRandom)
.Take(info.MaxRange)
.SkipWhile(p => resLayer.GetResource(p) == resourceType && resLayer.IsFull(p.X, p.Y))
.SkipWhile(p => resLayer.GetResource(p) == resourceType && resLayer.IsFull(p))
.Cast<CPos?>().FirstOrDefault();
if (cell != null && resLayer.CanSpawnResourceAt(resourceType, cell.Value))