make GiveMcvCrateAction less stupid, if the GiveUnitCrateAction says it can't do it.
This commit is contained in:
@@ -26,6 +26,9 @@ namespace OpenRA.Mods.RA.Crates
|
|||||||
|
|
||||||
public override int GetSelectionShares(Actor collector)
|
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();
|
var hasBase = self.World.Queries.OwnedBy[collector.Owner].WithTrait<BaseBuilding>().Any();
|
||||||
return hasBase ? info.SelectionShares : (info as GiveMcvCrateActionInfo).NoBaseSelectionShares;
|
return hasBase ? info.SelectionShares : (info as GiveMcvCrateActionInfo).NoBaseSelectionShares;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user