Remove Map.AssetExists.
This commit is contained in:
@@ -161,13 +161,6 @@ namespace OpenRA
|
|||||||
[FieldLoader.Ignore] public CellRegion AllCells;
|
[FieldLoader.Ignore] public CellRegion AllCells;
|
||||||
public List<CPos> AllEdgeCells { get; private set; }
|
public List<CPos> AllEdgeCells { get; private set; }
|
||||||
|
|
||||||
void AssertExists(string filename)
|
|
||||||
{
|
|
||||||
using (var s = Package.GetStream(filename))
|
|
||||||
if (s == null)
|
|
||||||
throw new InvalidOperationException("Required file {0} not present in this map".F(filename));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new map created by the editor or importer.
|
/// Initializes a new map created by the editor or importer.
|
||||||
/// The map will not receive a valid UID until after it has been saved and reloaded.
|
/// The map will not receive a valid UID until after it has been saved and reloaded.
|
||||||
@@ -208,8 +201,8 @@ namespace OpenRA
|
|||||||
this.modData = modData;
|
this.modData = modData;
|
||||||
Package = package;
|
Package = package;
|
||||||
|
|
||||||
AssertExists("map.yaml");
|
if (!Package.Contains("map.yaml") || !Package.Contains("map.bin"))
|
||||||
AssertExists("map.bin");
|
throw new InvalidDataException("Not a valid map\n File: {1}".F(package.Name));
|
||||||
|
|
||||||
var yaml = new MiniYaml(null, MiniYaml.FromStream(Package.GetStream("map.yaml"), package.Name));
|
var yaml = new MiniYaml(null, MiniYaml.FromStream(Package.GetStream("map.yaml"), package.Name));
|
||||||
FieldLoader.Load(this, yaml);
|
FieldLoader.Load(this, yaml);
|
||||||
|
|||||||
Reference in New Issue
Block a user