Fix a possible crash in ResourceLayer

This commit is contained in:
abcdefg30
2015-10-04 00:18:38 +02:00
parent f2f2fd8871
commit e291606dad

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));