Pull out a temporary variable in ProductionQueue.
This commit is contained in:
@@ -245,11 +245,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Enabled)
|
if (!Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var rules = self.World.Map.Rules;
|
||||||
switch (order.OrderString)
|
switch (order.OrderString)
|
||||||
{
|
{
|
||||||
case "StartProduction":
|
case "StartProduction":
|
||||||
{
|
{
|
||||||
var unit = self.World.Map.Rules.Actors[order.TargetString];
|
var unit = rules.Actors[order.TargetString];
|
||||||
var bi = unit.TraitInfo<BuildableInfo>();
|
var bi = unit.TraitInfo<BuildableInfo>();
|
||||||
if (!bi.Queue.Contains(Info.Type))
|
if (!bi.Queue.Contains(Info.Type))
|
||||||
return; /* Not built by this queue */
|
return; /* Not built by this queue */
|
||||||
@@ -281,13 +282,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var isBuilding = unit.HasTraitInfo<BuildingInfo>();
|
var isBuilding = unit.HasTraitInfo<BuildingInfo>();
|
||||||
|
|
||||||
if (isBuilding && !hasPlayedSound)
|
if (isBuilding && !hasPlayedSound)
|
||||||
hasPlayedSound = Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
else if (!isBuilding)
|
else if (!isBuilding)
|
||||||
{
|
{
|
||||||
if (BuildUnit(order.TargetString))
|
if (BuildUnit(order.TargetString))
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
else if (!hasPlayedSound && time > 0)
|
else if (!hasPlayedSound && time > 0)
|
||||||
hasPlayedSound = Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
|
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user