Remove upgrade pre-20151224 upgrade rules.

This commit is contained in:
Paul Chote
2016-02-21 11:54:21 +00:00
parent 1dcc43801a
commit a553b46d3b
3 changed files with 22 additions and 2924 deletions

View File

@@ -9,6 +9,7 @@
*/
#endregion
using System;
using OpenRA.FileSystem;
namespace OpenRA.Mods.Common.UtilityCommands
@@ -28,11 +29,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
// HACK: The engine code assumes that Game.modData is set.
Game.ModData = modData;
var engineDate = Exts.ParseIntegerInvariant(args[2]);
if (engineDate < UpgradeRules.MinimumSupportedVersion)
{
Console.WriteLine("Unsupported engine version. Use the release-{0} utility to update to that version, and then try again",
UpgradeRules.MinimumSupportedVersion);
return;
}
var package = modData.ModFiles.OpenWritablePackage(args[1]);
UpgradeRules.UpgradeMapFormat(modData, package);
var map = new Map(modData, package);
var engineDate = Exts.ParseIntegerInvariant(args[2]);
UpgradeRules.UpgradeWeaponRules(engineDate, ref map.WeaponDefinitions, null, 0);
UpgradeRules.UpgradeActorRules(engineDate, ref map.RuleDefinitions, null, 0);
UpgradeRules.UpgradePlayers(engineDate, ref map.PlayerDefinitions, null, 0);

View File

@@ -60,6 +60,12 @@ namespace OpenRA.Mods.Common.UtilityCommands
modData.MapCache.LoadMaps();
var engineDate = Exts.ParseIntegerInvariant(args[1]);
if (engineDate < UpgradeRules.MinimumSupportedVersion)
{
Console.WriteLine("Unsupported engine version. Use the release-{0} utility to update to that version, and then try again",
UpgradeRules.MinimumSupportedVersion);
return;
}
ProcessYaml("Rules", modData.Manifest.Rules, modData, engineDate, UpgradeRules.UpgradeActorRules);
ProcessYaml("Weapons", modData.Manifest.Weapons, modData, engineDate, UpgradeRules.UpgradeWeaponRules);

File diff suppressed because it is too large Load Diff