Separated resource rendering into another trait

This commit is contained in:
teinarss
2019-06-18 22:09:45 +02:00
committed by abcdefg30
parent 0e93d85273
commit f0b69f8b8d
16 changed files with 377 additions and 180 deletions

View File

@@ -269,7 +269,7 @@ namespace OpenRA.Mods.Common.Traits
if (cell.Layer != 0)
return false;
var resType = resLayer.GetResource(cell);
var resType = resLayer.GetResourceType(cell);
if (resType == null)
return false;
@@ -395,7 +395,7 @@ namespace OpenRA.Mods.Common.Traits
if (!self.Owner.Shroud.IsExplored(location))
return false;
var res = self.World.WorldActor.Trait<ResourceLayer>().GetRenderedResource(location);
var res = self.World.WorldActor.Trait<ResourceRenderer>().GetRenderedResourceType(location);
var info = self.Info.TraitInfo<HarvesterInfo>();
if (res == null || !info.Resources.Contains(res.Info.Type))