Extend INotifyOtherProduction to all actors.
This commit is contained in:
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
||||||
{
|
{
|
||||||
// No recursive cloning!
|
// No recursive cloning!
|
||||||
if (producer.HasTrait<ClonesProducedUnits>())
|
if (producer.Owner != self.Owner || producer.HasTrait<ClonesProducedUnits>())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var ci = produced.Info.Traits.GetOrDefault<CloneableInfo>();
|
var ci = produced.Info.Traits.GetOrDefault<CloneableInfo>();
|
||||||
|
|||||||
@@ -98,9 +98,7 @@ namespace OpenRA.Mods.RA
|
|||||||
foreach (var t in self.TraitsImplementing<INotifyProduction>())
|
foreach (var t in self.TraitsImplementing<INotifyProduction>())
|
||||||
t.UnitProduced(self, newUnit, exit);
|
t.UnitProduced(self, newUnit, exit);
|
||||||
|
|
||||||
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>()
|
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>();
|
||||||
.Where(a => a.Actor.Owner == self.Owner);
|
|
||||||
|
|
||||||
foreach (var notify in notifyOthers)
|
foreach (var notify in notifyOthers)
|
||||||
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
|
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user