Prepare short game code for trait-defined lobby options.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user