From ea3731a7cc2b122d24683db7568f4d48f861cf6a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 28 Oct 2018 18:22:17 +0000 Subject: [PATCH] Pass the original init dict to UnitProducedByOther. --- OpenRA.Mods.Cnc/Traits/Buildings/ClonesProducedUnits.cs | 2 +- OpenRA.Mods.Common/Scripting/ScriptTriggers.cs | 2 +- .../Traits/Conditions/ProximityExternalCondition.cs | 3 ++- OpenRA.Mods.Common/Traits/Production.cs | 2 +- OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs | 2 +- OpenRA.Mods.Common/Traits/ProductionParadrop.cs | 2 +- OpenRA.Mods.Common/TraitsInterfaces.cs | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.Cnc/Traits/Buildings/ClonesProducedUnits.cs index c2566d9ca5..fabe65be41 100644 --- a/OpenRA.Mods.Cnc/Traits/Buildings/ClonesProducedUnits.cs +++ b/OpenRA.Mods.Cnc/Traits/Buildings/ClonesProducedUnits.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Traits faction = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; } - public void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType) + public void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType, TypeDictionary init) { // No recursive cloning! if (producer.Owner != self.Owner || producer.Info.HasTraitInfo()) diff --git a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs index f94699afd5..502ed8ad1b 100644 --- a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs +++ b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs @@ -405,7 +405,7 @@ namespace OpenRA.Mods.Common.Scripting } } - public void UnitProducedByOther(Actor self, Actor producee, Actor produced, string productionType) + public void UnitProducedByOther(Actor self, Actor producee, Actor produced, string productionType, TypeDictionary init) { if (world.Disposing) return; diff --git a/OpenRA.Mods.Common/Traits/Conditions/ProximityExternalCondition.cs b/OpenRA.Mods.Common/Traits/Conditions/ProximityExternalCondition.cs index c62753595f..496c06c6e8 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/ProximityExternalCondition.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/ProximityExternalCondition.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System.Linq; +using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits @@ -120,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits tokens[a] = external.GrantCondition(a, self); } - public void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType) + public void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType, TypeDictionary init) { // If the produced Actor doesn't occupy space, it can't be in range if (produced.OccupiesSpace == null) diff --git a/OpenRA.Mods.Common/Traits/Production.cs b/OpenRA.Mods.Common/Traits/Production.cs index 3571ff4bb9..a6e32c7529 100644 --- a/OpenRA.Mods.Common/Traits/Production.cs +++ b/OpenRA.Mods.Common/Traits/Production.cs @@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits var notifyOthers = self.World.ActorsWithTrait(); foreach (var notify in notifyOthers) - notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType); + notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType, td); }); } diff --git a/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs b/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs index 0bd654801c..aea18e07fe 100644 --- a/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs +++ b/OpenRA.Mods.Common/Traits/ProductionFromMapEdge.cs @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits var notifyOthers = self.World.ActorsWithTrait(); foreach (var notify in notifyOthers) - notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType); + notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType, td); }); return true; diff --git a/OpenRA.Mods.Common/Traits/ProductionParadrop.cs b/OpenRA.Mods.Common/Traits/ProductionParadrop.cs index ed475c7bcb..21c087aaa4 100644 --- a/OpenRA.Mods.Common/Traits/ProductionParadrop.cs +++ b/OpenRA.Mods.Common/Traits/ProductionParadrop.cs @@ -157,7 +157,7 @@ namespace OpenRA.Mods.Common.Traits var notifyOthers = self.World.ActorsWithTrait(); foreach (var notify in notifyOthers) - notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType); + notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit, productionType, td); }); } } diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 58c7d6a3ae..e76a025425 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -131,7 +131,7 @@ namespace OpenRA.Mods.Common.Traits public interface INotifyBurstComplete { void FiredBurst(Actor self, Target target, Armament a); } public interface INotifyChat { bool OnChat(string from, string message); } public interface INotifyProduction { void UnitProduced(Actor self, Actor other, CPos exit); } - public interface INotifyOtherProduction { void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType); } + 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); } public interface INotifyDocking { void Docked(Actor self, Actor harvester); void Undocked(Actor self, Actor harvester); } public interface INotifyParachute { void OnParachute(Actor self); void OnLanded(Actor self, Actor ignore); }