Merge pull request #9528 from abcdefg30/seedsoutofbounds

Fix a possible crash in ResourceLayer
This commit is contained in:
Matthias Mailänder
2015-10-04 21:40:39 +02:00

View File

@@ -203,6 +203,9 @@ namespace OpenRA.Mods.Common.Traits
public bool CanSpawnResourceAt(ResourceType newResourceType, CPos cell)
{
if (!world.Map.Contains(cell))
return false;
var currentResourceType = GetResource(cell);
return (currentResourceType == newResourceType && !IsFull(cell))
|| (currentResourceType == null && AllowResourceAt(newResourceType, cell));