Add plumbing for short game option

This commit is contained in:
Oliver Brakmann
2014-11-17 18:44:32 +01:00
parent 470ae17271
commit 280b30961f
7 changed files with 57 additions and 5 deletions

View File

@@ -17,7 +17,11 @@ namespace OpenRA.Mods.Common
{
public static bool HasNoRequiredUnits(this Player player)
{
return player.World.ActorsWithTrait<MustBeDestroyed>().All(p => p.Actor.Owner != player);
return !player.World.ActorsWithTrait<MustBeDestroyed>().Any(p =>
{
return p.Actor.Owner == player &&
(player.World.LobbyInfo.GlobalSettings.ShortGame ? p.Trait.Info.RequiredForShortGame : p.Actor.IsInWorld);
});
}
}
}