diff --git a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs index d2c6a6d377..bdb2b353e6 100755 --- a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs @@ -18,13 +18,21 @@ namespace OpenRA.Mods.RA { public class ClassicProductionQueueInfo : ProductionQueueInfo, Requires, Requires, Requires { + public readonly float SpeedUp = 0; + public readonly float MaxSpeedUp = 0; + public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); } } public class ClassicProductionQueue : ProductionQueue, ISync { - public ClassicProductionQueue( Actor self, ClassicProductionQueueInfo info ) - : base(self, self, info) {} + public new ClassicProductionQueueInfo Info; + + public ClassicProductionQueue(Actor self, ClassicProductionQueueInfo info) + : base(self, self, info) + { + this.Info = info; + } [Sync] bool isActive = false; @@ -86,8 +94,10 @@ namespace OpenRA.Mods.RA .Where(p => p.Trait.Info.Produces.Contains(unit.Traits.Get().Queue)) .Where(p => p.Actor.Owner == self.Owner).ToArray(); - var speedUp = 1 - (selfsameBuildings.First().Trait.Info.SpeedUp * (selfsameBuildings.Count() - 1)) - .Clamp(0, selfsameBuildings.First().Trait.Info.MaxSpeedUp); + var selfsameQueue = Rules.Info["player"].Traits.WithInterface() + .First(p => selfsameBuildings.First().Trait.Info.Produces.Contains(p.Type)); + + var speedUp = 1 - (selfsameQueue.SpeedUp * (selfsameBuildings.Count() - 1)).Clamp(0, selfsameQueue.MaxSpeedUp); var time = cost * Info.BuildSpeed diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index 9da5edf268..16325451a0 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -22,9 +22,6 @@ namespace OpenRA.Mods.RA { public readonly string[] Produces = { }; - public readonly float SpeedUp = 0; - public readonly float MaxSpeedUp = 0; - public virtual object Create(ActorInitializer init) { return new Production(this); } }