diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index b9a387ac59..3a8f98058b 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -362,13 +362,12 @@ namespace OpenRA.Editor if (DialogResult.OK == nmd.ShowDialog()) { - var map = new Map(); + var map = new Map(nmd.theater.SelectedItem as string); map.Resize((int)nmd.width.Value, (int)nmd.height.Value); map.TopLeft = new int2((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value); map.BottomRight = new int2((int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value); - map.Tileset = nmd.theater.SelectedItem as string; map.Players.Add("Neutral", new PlayerReference("Neutral", Rules.Info["world"].Traits.WithInterface().First().Race, true, true)); NewMap(map); } diff --git a/OpenRA.Game/Map.cs b/OpenRA.Game/Map.cs index a108bee8c1..cc456aa894 100755 --- a/OpenRA.Game/Map.cs +++ b/OpenRA.Game/Map.cs @@ -62,14 +62,22 @@ namespace OpenRA public Rectangle Bounds { get { return Rectangle.FromLTRB(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y); } } public Map() + { + // Do nothing; not a valid map (editor hack) + } + + public Map(string tileset) { MapSize = new int2(1, 1); + Tileset = tileset; MapResources = new TileReference[1, 1]; - MapTiles = new TileReference[1, 1] - { { new TileReference { - type = (ushort)0xffffu, - image = (byte)0xffu, - index = (byte)0xffu } } }; + + var tile = OpenRA.Rules.TileSets[Tileset].Templates.First(); + MapTiles = new TileReference[1, 1] + { { new TileReference { + type = tile.Key, + image = (byte)(tile.Value.PickAny ? 0xffu : 0), + index = (byte)(tile.Value.PickAny ? 0xffu : 0) } } }; PlayerCount = 0; TopLeft = new int2(0, 0); diff --git a/mods/d2k/maps/test/map.bin b/mods/d2k/maps/test/map.bin index f804ba89a4..4d976970b4 100644 Binary files a/mods/d2k/maps/test/map.bin and b/mods/d2k/maps/test/map.bin differ diff --git a/mods/d2k/maps/test/map.uid b/mods/d2k/maps/test/map.uid index a933856a13..3c154eea5a 100644 --- a/mods/d2k/maps/test/map.uid +++ b/mods/d2k/maps/test/map.uid @@ -1 +1 @@ -899fa73ce1ffd82799e84b63256930514db5e048 \ No newline at end of file +1e36d6874ef7960ac0e21edf36bbe1490a4650eb \ No newline at end of file diff --git a/mods/d2k/maps/test/map.yaml b/mods/d2k/maps/test/map.yaml index 48df90a552..c688669572 100644 --- a/mods/d2k/maps/test/map.yaml +++ b/mods/d2k/maps/test/map.yaml @@ -32,27 +32,11 @@ Players: InitialCash: 0 Allies: Enemies: - PlayerReference@Multi0: - Name: Multi0 - Palette: - Race: Random - OwnsWorld: False - NonCombatant: False - Playable: True - DefaultStartingUnits: True - Color: 255,238,238,238 - Color2: 255,44,28,24 - InitialCash: 0 - Allies: - Enemies: Actors: - Actor0: mcv - Location: 16,17 - Owner: Neutral Waypoints: - wp0: 18,18 + wp0: 20,20 Smudges: diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 1cb04d8398..07ebe5c9f0 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -33,5 +33,5 @@ TileSets: Music: Movies: LoadScreen: NullLoadScreen -ShellmapUid:899fa73ce1ffd82799e84b63256930514db5e048 +ShellmapUid:1e36d6874ef7960ac0e21edf36bbe1490a4650eb TileSize:32 diff --git a/mods/d2k/tilesets/arrakis.yaml b/mods/d2k/tilesets/arrakis.yaml index 6af55956db..b32dcd1fe0 100644 --- a/mods/d2k/tilesets/arrakis.yaml +++ b/mods/d2k/tilesets/arrakis.yaml @@ -14,13 +14,6 @@ Terrain: Color: 255,255,255,255 Templates: - Template@65535: - Id: 65535 - Image: t00 - Size: 1,1 - PickAny: False - Tiles: - 0: Clear Template@0: Id: 0 Image: t00