diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 563acaeece..088f7d515a 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -63,6 +63,7 @@ namespace OpenRA.Traits public interface IValidateOrder { bool OrderValidation(OrderManager orderManager, World world, int clientId, Order order); } public interface IOrderVoice { string VoicePhraseForOrder(Actor self, Order order); } public interface INotify { void Play(Player p, string notification); } + public interface INotifyCreated { void Created(Actor self); } public interface INotifyAddedToWorld { void AddedToWorld(Actor self); } public interface INotifyRemovedFromWorld { void RemovedFromWorld(Actor self); } public interface INotifySold { void Selling(Actor self); void Sold(Actor self); } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 50b04194e5..d58d68e474 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -188,6 +188,8 @@ namespace OpenRA public Actor CreateActor(bool addToWorld, string name, TypeDictionary initDict) { var a = new Actor(this, name, initDict); + foreach (var t in a.TraitsImplementing()) + t.Created(a); if (addToWorld) Add(a); return a;