From 98106e2ff78e5029f228e5d0aff863ec96ed62f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Aug 2014 16:22:20 +0200 Subject: [PATCH] ContainsCrate is redundant to LeavesHusk --- OpenRA.Mods.RA/ContainsCrate.cs | 30 ---------------------------- OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 - OpenRA.Utility/UpgradeRules.cs | 10 ++++++++++ 3 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 OpenRA.Mods.RA/ContainsCrate.cs diff --git a/OpenRA.Mods.RA/ContainsCrate.cs b/OpenRA.Mods.RA/ContainsCrate.cs deleted file mode 100644 index 52d9346315..0000000000 --- a/OpenRA.Mods.RA/ContainsCrate.cs +++ /dev/null @@ -1,30 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using OpenRA.Primitives; -using OpenRA.Traits; - -namespace OpenRA.Mods.RA -{ - [Desc("Leave a \"crate\" actor after destruction.")] - public class ContainsCrateInfo : TraitInfo { } - - public class ContainsCrate : INotifyKilled - { - public void Killed(Actor self, AttackInfo e) - { - self.World.AddFrameEndTask(w => w.CreateActor("crate", new TypeDictionary - { - new LocationInit(self.Location), - new OwnerInit(self.World.WorldActor.Owner), - })); - } - } -} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 1148e35b16..0a1adbc83e 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -191,7 +191,6 @@ - diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index afed5bc493..344fb1e16d 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -354,6 +354,16 @@ namespace OpenRA.Utility } } + if (engineVersion < 20140803) + { + // ContainsCrate was removed (use LeavesHusk instead) + if (depth == 1 && node.Key == "ContainsCrate") + { + node.Key = "LeavesHusk"; + node.Value.Nodes.Add(new MiniYamlNode("HuskActor", new MiniYaml("crate"))); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }