Map ctor no longer assumes anything about mods (fixes cnc custom-map crash)

This commit is contained in:
Paul Chote
2010-07-17 12:03:25 +12:00
parent 239fff20f4
commit 9875a968bc
4 changed files with 4 additions and 9 deletions

View File

@@ -68,7 +68,7 @@ editor_EXTRA = -resource:OpenRA.Editor.Form1.resources
mapcvtr_SRCS = $(shell find MapConverter/ -iname '*.cs') mapcvtr_SRCS = $(shell find MapConverter/ -iname '*.cs')
mapcvtr_TARGET = MapConverter.exe mapcvtr_TARGET = MapConverter.exe
mapcvtr_KIND = winexe mapcvtr_KIND = winexe
mapcvtr_DEPS = $(fileformats_TARGET) mapcvtr_DEPS = $(fileformats_TARGET) $(game_TARGET)
mapcvtr_LIBS = $(COMMON_LIBS) $(mapcvtr_DEPS) mapcvtr_LIBS = $(COMMON_LIBS) $(mapcvtr_DEPS)
ralint_SRCS = $(shell find RALint/ -iname '*.cs') ralint_SRCS = $(shell find RALint/ -iname '*.cs')

View File

@@ -378,8 +378,7 @@ namespace OpenRA.Editor
map.TopLeft = new int2((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.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.BottomRight = new int2((int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
map.Tileset = nmd.theater.SelectedItem as string; map.Tileset = nmd.theater.SelectedItem as string;
map.Players.Add("Neutral", new PlayerReference("Neutral", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
NewMap(map); NewMap(map);
} }
} }

View File

@@ -92,9 +92,6 @@ namespace OpenRA.FileFormats
TopLeft = new int2(0, 0); TopLeft = new int2(0, 0);
BottomRight = new int2(0, 0); BottomRight = new int2(0, 0);
Tileset = "TEMPERAT";
Players.Add("Neutral", new PlayerReference("Neutral", "neutral", "allies", true, true));
Title = "Name your map here"; Title = "Name your map here";
Description = "Describe your map here"; Description = "Describe your map here";
Author = "Your name here"; Author = "Your name here";
@@ -118,7 +115,7 @@ namespace OpenRA.FileFormats
// Players // Players
if (MapFormat == 1) if (MapFormat == 1)
{ {
Players.Add("Neutral", new PlayerReference("Neutral", "neutral", "allies", true, true)); Players.Add("Neutral", new PlayerReference("Neutral", "allies", true, true));
} }
else else
{ {

View File

@@ -36,10 +36,9 @@ namespace OpenRA.FileFormats
FieldLoader.Load(this, my); FieldLoader.Load(this, my);
} }
public PlayerReference(string name, string palette, string race, bool ownsworld, bool noncombatant) public PlayerReference(string name, string race, bool ownsworld, bool noncombatant)
{ {
Name = name; Name = name;
Palette = palette;
Race = race; Race = race;
OwnsWorld = ownsworld; OwnsWorld = ownsworld;
NonCombatant = noncombatant; NonCombatant = noncombatant;