Fix root cause for `world owned by creep' bugs
This commit is contained in:
@@ -87,8 +87,13 @@ namespace OpenRA.Editor
|
|||||||
// upgrade maps that have no player definitions. editor doesnt care,
|
// upgrade maps that have no player definitions. editor doesnt care,
|
||||||
// but this breaks the game pretty badly.
|
// but this breaks the game pretty badly.
|
||||||
if (map.Players.Count == 0)
|
if (map.Players.Count == 0)
|
||||||
map.Players.Add("Neutral", new PlayerReference("Neutral",
|
map.Players.Add("Neutral", new PlayerReference
|
||||||
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
|
{
|
||||||
|
Name = "Neutral",
|
||||||
|
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
|
||||||
|
OwnsWorld = true,
|
||||||
|
NonCombatant = true
|
||||||
|
});
|
||||||
|
|
||||||
PrepareMapResources(Game.modData.Manifest, map);
|
PrepareMapResources(Game.modData.Manifest, map);
|
||||||
|
|
||||||
@@ -321,8 +326,22 @@ namespace OpenRA.Editor
|
|||||||
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
|
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
|
||||||
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
|
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
|
||||||
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
|
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
|
||||||
map.Players.Add("Neutral", new PlayerReference("Neutral", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
|
|
||||||
map.Players.Add("Creeps", new PlayerReference("Creeps", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
|
map.Players.Add("Neutral", new PlayerReference
|
||||||
|
{
|
||||||
|
Name = "Neutral",
|
||||||
|
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
|
||||||
|
OwnsWorld = true,
|
||||||
|
NonCombatant = true
|
||||||
|
});
|
||||||
|
|
||||||
|
map.Players.Add("Creeps", new PlayerReference
|
||||||
|
{
|
||||||
|
Name = "Creeps",
|
||||||
|
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
|
||||||
|
NonCombatant = true
|
||||||
|
});
|
||||||
|
|
||||||
NewMap(map);
|
NewMap(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,14 +395,23 @@ namespace OpenRA.Editor
|
|||||||
if (errors.Count > 0)
|
if (errors.Count > 0)
|
||||||
using (var eld = new ErrorListDialog(errors))
|
using (var eld = new ErrorListDialog(errors))
|
||||||
eld.ShowDialog();
|
eld.ShowDialog();
|
||||||
|
|
||||||
if (!map.Players.ContainsKey("Neutral"))
|
if (!map.Players.ContainsKey("Neutral"))
|
||||||
map.Players.Add("Neutral", new PlayerReference("Neutral",
|
map.Players.Add("Neutral", new PlayerReference
|
||||||
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
|
{
|
||||||
|
Name = "Neutral",
|
||||||
map.Players.Add("Creeps", new PlayerReference("Creeps",
|
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
|
||||||
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
|
OwnsWorld = true,
|
||||||
|
NonCombatant = true
|
||||||
|
});
|
||||||
|
|
||||||
|
map.Players.Add("Creeps", new PlayerReference
|
||||||
|
{
|
||||||
|
Name = "Creeps",
|
||||||
|
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
|
||||||
|
NonCombatant = true
|
||||||
|
});
|
||||||
|
|
||||||
map.Save(savePath);
|
map.Save(savePath);
|
||||||
LoadMap(savePath);
|
LoadMap(savePath);
|
||||||
loadedMapName = null; /* editor needs to think this hasnt been saved */
|
loadedMapName = null; /* editor needs to think this hasnt been saved */
|
||||||
|
|||||||
@@ -38,13 +38,5 @@ namespace OpenRA.FileFormats
|
|||||||
{
|
{
|
||||||
FieldLoader.Load(this, my);
|
FieldLoader.Load(this, my);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerReference(string name, string race, bool ownsworld, bool noncombatant)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
Race = race;
|
|
||||||
OwnsWorld = ownsworld;
|
|
||||||
NonCombatant = noncombatant;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user