Allow actors to force a specific race variant.

This commit is contained in:
Paul Chote
2015-02-13 19:12:07 +00:00
parent d1ed1bf0fb
commit 7b27b803f9
4 changed files with 17 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ namespace OpenRA.Mods.Common.Traits
var race = producer.Trait != null ? producer.Trait.Race : self.Owner.Country.Race;
var buildingInfo = unit.Traits.Get<BuildingInfo>();
var buildableInfo = unit.Traits.GetOrDefault<BuildableInfo>();
if (buildableInfo != null && buildableInfo.ForceRace != null)
race = buildableInfo.ForceRace;
if (order.OrderString == "LineBuild")
{
var playSounds = true;