Add resource updating methods to IResourceLayer.

This commit is contained in:
Paul Chote
2021-01-19 19:29:42 +00:00
committed by reaperrr
parent 7e9d291223
commit 0b93556c06
6 changed files with 177 additions and 81 deletions

View File

@@ -81,14 +81,14 @@ namespace OpenRA.Mods.Common.Activities
}
}
var resource = resLayer.Harvest(self.Location);
if (resource == null)
var resourceType = resLayer.GetResourceType(self.Location);
if (resourceType == null || resLayer.RemoveResource(resourceType, self.Location) != 1)
return true;
harv.AcceptResource(self, resource);
harv.AcceptResource(self, resourceType);
foreach (var t in notifyHarvesterActions)
t.Harvested(self, resource);
t.Harvested(self, resourceType);
QueueChild(new Wait(harvInfo.BaleLoadDelay));
return false;