Extend INotifyOtherProduction to all actors.

This commit is contained in:
Paul Chote
2014-10-04 13:50:21 +13:00
parent 1a5ff440d1
commit bf2bc0c02e
2 changed files with 2 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
{
// No recursive cloning!
if (producer.HasTrait<ClonesProducedUnits>())
if (producer.Owner != self.Owner || producer.HasTrait<ClonesProducedUnits>())
return;
var ci = produced.Info.Traits.GetOrDefault<CloneableInfo>();

View File

@@ -98,9 +98,7 @@ namespace OpenRA.Mods.RA
foreach (var t in self.TraitsImplementing<INotifyProduction>())
t.UnitProduced(self, newUnit, exit);
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>()
.Where(a => a.Actor.Owner == self.Owner);
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>();
foreach (var notify in notifyOthers)
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);