This commit is contained in:
Bob
2009-10-24 19:49:27 +13:00
4 changed files with 58 additions and 11 deletions

View File

@@ -191,14 +191,16 @@ namespace OpenRa.Game
if (producer == null)
throw new InvalidOperationException("BuildUnit without suitable production structure!");
var unit = new Actor(name, (1/24f * producer.CenterLocation).ToInt2(), player);
var mobile = unit.traits.Get<Mobile>();
mobile.facing = 128;
var unit = new Actor(name, (1/24f * producer.CenterLocation).ToInt2(), player);
var mobile = unit.traits.Get<Mobile>();
mobile.facing = 128;
mobile.QueueAction( new Traits.Mobile.MoveTo( unit.Location + new int2( 0, 3 ) ) );
world.AddFrameEndTask(_ => world.Add(unit));
// todo: make the producing building play `build`
if (producer.traits.Contains<RenderWarFactory>())
producer.traits.Get<RenderWarFactory>().EjectUnit();
}
}
}