Fix build palette showing too many queued items when BuildLimit is reached

When a BuildLimit on an actor type is set and nearly reached, you could
shift-click the build palette and it would show it had five more items
queued when really less are allowed to be built. This fixes it so that
only the allowed number of items is enqueued, and thus showing the
correct number on the build palette.
This commit is contained in:
Oliver Brakmann
2014-04-26 16:14:48 +02:00
parent e572c0dcb6
commit 63f4a0646f
2 changed files with 13 additions and 8 deletions

View File

@@ -224,17 +224,17 @@ namespace OpenRA
public static Order StartProduction(Actor subject, string item, int count)
{
return new Order("StartProduction", subject, false) { TargetLocation = new CPos(count, 0), TargetString = item };
return new Order("StartProduction", subject, false) { ExtraData = (uint)count, TargetString = item };
}
public static Order PauseProduction(Actor subject, string item, bool pause)
{
return new Order("PauseProduction", subject, false) { TargetLocation = new CPos(pause ? 1 : 0, 0), TargetString = item };
return new Order("PauseProduction", subject, false) { ExtraData = pause ? 1u : 0u, TargetString = item };
}
public static Order CancelProduction(Actor subject, string item, int count)
{
return new Order("CancelProduction", subject, false) { TargetLocation = new CPos(count, 0), TargetString = item };
return new Order("CancelProduction", subject, false) { ExtraData = (uint)count, TargetString = item };
}
}
}