Restored production queue current item checks

Fixes regression #5948 where you could freely build any building by
canceling the production before deploying by restoring the currentItem
checks in the PlaceBuilding order to ensure that the production is still
valid.
This commit is contained in:
Squiggles211
2014-07-13 14:06:30 -05:00
parent aca0b9d7dd
commit 006f7b888a

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
var unit = self.World.Map.Rules.Actors[order.TargetString];
var queue = order.TargetActor.TraitsImplementing<ProductionQueue>()
.FirstOrDefault(q => q.CanBuild(unit));
.FirstOrDefault(q => q.CanBuild(unit) && q.CurrentItem() != null && q.CurrentItem().Item == order.TargetString && q.CurrentItem().RemainingTime == 0);
if (queue == null)
return;