remove most of the crap from queries

This commit is contained in:
Chris Forbes
2011-03-17 21:48:50 +13:00
parent eba7641125
commit 149324ea92
21 changed files with 113 additions and 129 deletions

View File

@@ -29,8 +29,11 @@ namespace OpenRA.Mods.RA.Crates
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;
var hasBase = self.World.Queries.WithTrait<BaseBuilding>()
.Any(a => a.Actor.Owner == collector.Owner);
return hasBase ? info.SelectionShares :
(info as GiveMcvCrateActionInfo).NoBaseSelectionShares;
}
}
}