Generalize factionVariant to a TypeDictionary of Inits.

This commit is contained in:
Paul Chote
2017-08-18 17:39:20 +00:00
committed by Pavel Penev
parent 315cc966f4
commit cfac996438
10 changed files with 77 additions and 45 deletions

View File

@@ -12,6 +12,7 @@
using System.Collections.Generic;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
@@ -49,7 +50,13 @@ namespace OpenRA.Mods.Cnc.Traits
if (ci == null || !info.CloneableTypes.Overlaps(ci.Types))
return;
production.Produce(self, produced.Info, faction);
var inits = new TypeDictionary
{
new OwnerInit(self.Owner),
new FactionInit(BuildableInfo.GetInitialFaction(produced.Info, faction))
};
production.Produce(self, produced.Info, inits);
}
}
}