diff --git a/OpenRA.Mods.Common/Activities/LayMines.cs b/OpenRA.Mods.Common/Activities/LayMines.cs index 32cb0f2bd8..853a75b97c 100644 --- a/OpenRA.Mods.Common/Activities/LayMines.cs +++ b/OpenRA.Mods.Common/Activities/LayMines.cs @@ -147,11 +147,20 @@ namespace OpenRA.Mods.Common.Activities pool.TakeAmmo(self, minelayer.Info.AmmoUsage); } - self.World.AddFrameEndTask(w => w.CreateActor(minelayer.Info.Mine, new TypeDictionary + foreach (var t in self.TraitsImplementing()) + t.MineLaying(self, self.Location); + + self.World.AddFrameEndTask(w => { - new LocationInit(self.Location), - new OwnerInit(self.Owner), - })); + var mine = w.CreateActor(minelayer.Info.Mine, new TypeDictionary + { + new LocationInit(self.Location), + new OwnerInit(self.Owner), + }); + + foreach (var t in self.TraitsImplementing()) + t.MineLaid(self, mine); + }); } } } diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 423928baf2..95641c303d 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -158,6 +158,9 @@ namespace OpenRA.Mods.Common.Traits public interface INotifyOtherProduction { void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType, TypeDictionary init); } public interface INotifyDelivery { void IncomingDelivery(Actor self); void Delivered(Actor self); } + [RequireExplicitImplementation] + public interface INotifyMineLaying { void MineLaying(Actor self, CPos location); void MineLaid(Actor self, Actor mine); } + [RequireExplicitImplementation] public interface INotifyDockHost { void Docked(Actor self, Actor client); void Undocked(Actor self, Actor client); } [RequireExplicitImplementation]