From be2c41d51c8334933bb56cb9d21537f218444c3d Mon Sep 17 00:00:00 2001 From: Andre Mohren Date: Thu, 26 Jul 2018 18:50:11 +0200 Subject: [PATCH] Added PlaceBuildingInit. --- OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs index d0d6ef9f08..fb794132d5 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs @@ -16,6 +16,9 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { + // Allows third party mods to detect whether an actor was created by PlaceBuilding. + public class PlaceBuildingInit : IActorInit { } + [Desc("Allows the player to execute build orders.", " Attach this to the player actor.")] public class PlaceBuildingInfo : ITraitInfo { @@ -84,6 +87,7 @@ namespace OpenRA.Mods.Common.Traits new LocationInit(order.TargetLocation), new OwnerInit(order.Player), new FactionInit(faction), + new PlaceBuildingInit() }); foreach (var s in buildingInfo.BuildSounds) @@ -105,7 +109,8 @@ namespace OpenRA.Mods.Common.Traits new OwnerInit(order.Player), new FactionInit(faction), new LineBuildDirectionInit(t.First.X == order.TargetLocation.X ? LineBuildDirection.Y : LineBuildDirection.X), - new LineBuildParentInit(new[] { t.Second, placed }) + new LineBuildParentInit(new[] { t.Second, placed }), + new PlaceBuildingInit() }); } } @@ -153,6 +158,7 @@ namespace OpenRA.Mods.Common.Traits new LocationInit(order.TargetLocation), new OwnerInit(order.Player), new FactionInit(faction), + new PlaceBuildingInit() }); foreach (var s in buildingInfo.BuildSounds)