removed TileReference.density

This commit is contained in:
Chris Forbes
2010-03-02 22:29:17 +13:00
parent 2c50d3baa7
commit 0c9e628bf9
9 changed files with 67 additions and 87 deletions

View File

@@ -49,17 +49,16 @@ namespace OpenRA.Traits.Activities
var harv = self.traits.Get<Harvester>();
var renderUnit = self.traits.Get<RenderUnit>(); /* better have one of these! */
var isGem = false;
if (!self.World.Map.ContainsResource(self.Location) ||
!self.World.Map.Harvest(self.Location, out isGem))
var resource = self.World.WorldActor.traits.Get<ResourceLayer>().Harvest(self.Location);
if (resource == null)
return false;
if (renderUnit.anim.CurrentSequence.Name != "harvest")
{
isHarvesting = true;
renderUnit.PlayCustomAnimation(self, "harvest", () => isHarvesting = false);
}
harv.AcceptResource(isGem);
harv.AcceptResource(resource);
return true;
}