Fix multi-turreted actors not appearing in the map editor.

This commit is contained in:
Paul Chote
2018-03-22 08:06:48 +00:00
committed by abcdefg30
parent 6b24271a17
commit 7e94fa8c8a

View File

@@ -35,6 +35,9 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<object> IActorPreviewInitInfo.ActorPreviewInits(ActorInfo ai, ActorPreviewType type)
{
// HACK: The ActorInit system does not support multiple instances of the same type
// Make sure that we only return one TurretFacingInit, even for actors with multiple turrets
if (ai.TraitInfos<TurretedInfo>().FirstOrDefault() == this)
yield return new TurretFacingInit(PreviewFacing);
}