Prepare short game code for trait-defined lobby options.

This commit is contained in:
Paul Chote
2016-04-24 15:35:37 +01:00
parent e3bc73a168
commit 0a7c80ef6e
2 changed files with 11 additions and 2 deletions

View File

@@ -18,7 +18,8 @@ namespace OpenRA.Mods.Common
{
public static bool HasNoRequiredUnits(this Player player)
{
if (player.World.LobbyInfo.GlobalSettings.ShortGame)
var mapOptions = player.World.WorldActor.Trait<MapOptions>();
if (mapOptions.ShortGame)
return !player.World.ActorsHavingTrait<MustBeDestroyed>(t => t.Info.RequiredForShortGame).Any(a => a.Owner == player);
return !player.World.ActorsHavingTrait<MustBeDestroyed>().Any(a => a.Owner == player && a.IsInWorld);
}