ContainsCrate is redundant to LeavesHusk

This commit is contained in:
Matthias Mailänder
2014-08-03 16:22:20 +02:00
parent 57463f249c
commit 98106e2ff7
3 changed files with 10 additions and 31 deletions

View File

@@ -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<ContainsCrate> { }
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),
}));
}
}
}

View File

@@ -191,7 +191,6 @@
<Compile Include="Cloak.cs" />
<Compile Include="Combat.cs" />
<Compile Include="ConquestVictoryConditions.cs" />
<Compile Include="ContainsCrate.cs" />
<Compile Include="Crate.cs" />
<Compile Include="CrateAction.cs" />
<Compile Include="CrateSpawner.cs" />

View File

@@ -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);
}
}