Skip to content

Commit

Permalink
Fix multi-turreted actors not appearing in the map editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote authored and abcdefg30 committed Mar 22, 2018
1 parent 6b24271 commit 7e94fa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OpenRA.Mods.Common/Traits/Turreted.cs
Expand Up @@ -35,7 +35,10 @@ public class TurretedInfo : ITraitInfo, UsesInit<TurretFacingInit>, Requires<Bod

IEnumerable<object> IActorPreviewInitInfo.ActorPreviewInits(ActorInfo ai, ActorPreviewType type)
{
yield return new TurretFacingInit(PreviewFacing);
// 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);
}

public virtual object Create(ActorInitializer init) { return new Turreted(init, this); }
Expand Down

0 comments on commit 7e94fa8

Please sign in to comment.