Prevent saving and starting a map when max player count is exceeded.
This commit is contained in:
@@ -336,9 +336,6 @@ namespace OpenRA
|
||||
throw new InvalidDataException($"Map format {MapFormat} is not supported.\n File: {package.Name}");
|
||||
|
||||
PlayerDefinitions = MiniYaml.NodesOrEmpty(yaml, "Players");
|
||||
if (PlayerDefinitions.Count > 64)
|
||||
throw new InvalidDataException($"Maps must not define more than 64 players.\n File: {package.Name}");
|
||||
|
||||
ActorDefinitions = MiniYaml.NodesOrEmpty(yaml, "Actors");
|
||||
|
||||
Grid = modData.Manifest.Get<MapGrid>();
|
||||
|
||||
@@ -17,6 +17,10 @@ namespace OpenRA
|
||||
{
|
||||
public class MapPlayers
|
||||
{
|
||||
// Player masks are represented using a 64 bit integer
|
||||
// The "Everyone" player for spectators is created at runtime,
|
||||
// reducing the available player count for maps by 1.
|
||||
public const int MaximumPlayerCount = 63;
|
||||
public readonly Dictionary<string, PlayerReference> Players;
|
||||
|
||||
public MapPlayers()
|
||||
|
||||
Reference in New Issue
Block a user