From 7e94fa8c8a4c3c24c469732d75d128a1fa279469 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 22 Mar 2018 08:06:48 +0000 Subject: [PATCH] Fix multi-turreted actors not appearing in the map editor. --- OpenRA.Mods.Common/Traits/Turreted.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Turreted.cs b/OpenRA.Mods.Common/Traits/Turreted.cs index f813d21822..f77ca88b08 100644 --- a/OpenRA.Mods.Common/Traits/Turreted.cs +++ b/OpenRA.Mods.Common/Traits/Turreted.cs @@ -35,7 +35,10 @@ namespace OpenRA.Mods.Common.Traits IEnumerable 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().FirstOrDefault() == this) + yield return new TurretFacingInit(PreviewFacing); } public virtual object Create(ActorInitializer init) { return new Turreted(init, this); }