Fix style errors in ProductionQueue.cs
This commit is contained in:
@@ -249,17 +249,19 @@ namespace OpenRA.Mods.Common.Traits
|
||||
switch (order.OrderString)
|
||||
{
|
||||
case "StartProduction":
|
||||
{
|
||||
var unit = rules.Actors[order.TargetString];
|
||||
var bi = unit.TraitInfo<BuildableInfo>();
|
||||
|
||||
// Not built by this queue
|
||||
if (!bi.Queue.Contains(Info.Type))
|
||||
return; /* Not built by this queue */
|
||||
return;
|
||||
|
||||
var cost = unit.HasTraitInfo<ValuedInfo>() ? unit.TraitInfo<ValuedInfo>().Cost : 0;
|
||||
var time = GetBuildTime(order.TargetString);
|
||||
|
||||
// You can't build that
|
||||
if (BuildableItems().All(b => b.Name != order.TargetString))
|
||||
return; /* you can't build that!! */
|
||||
return;
|
||||
|
||||
// Check if the player is trying to build more units that they are allowed
|
||||
var fromLimit = int.MaxValue;
|
||||
@@ -294,23 +296,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "PauseProduction":
|
||||
{
|
||||
if (queue.Count > 0 && queue[0].Item == order.TargetString)
|
||||
queue[0].Pause(order.ExtraData != 0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "CancelProduction":
|
||||
{
|
||||
CancelProduction(order.TargetString, order.ExtraData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int GetBuildTime(string unitString)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user