make GiveMcvCrateAction less stupid, if the GiveUnitCrateAction says it can't do it.

This commit is contained in:
Chris Forbes
2010-10-15 18:38:09 +13:00
parent 3e547102d2
commit 9ae452e8d6

View File

@@ -26,6 +26,9 @@ namespace OpenRA.Mods.RA.Crates
public override int GetSelectionShares(Actor collector)
{
if (base.GetSelectionShares(collector) == 0)
return 0; // there's some other really good reason why we shouldn't give this.
var hasBase = self.World.Queries.OwnedBy[collector.Owner].WithTrait<BaseBuilding>().Any();
return hasBase ? info.SelectionShares : (info as GiveMcvCrateActionInfo).NoBaseSelectionShares;
}