Skip to content

Commit

Permalink
Fix the insert NODE at position that blowfish found
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Apr 24, 2016
1 parent 95c333b commit c8ccaa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,15 +1948,18 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
{
ConfigNode newSubMod = new ConfigNode(subMod.name);
newSubMod = ModifyNode(newSubMod, subMod);
subName = newSubMod.name;
int index;
if (subName.Contains(",") && int.TryParse(subName.Split(',')[1], out index))
{
// In this case insert the node at position index (with the same node names)
subMod.name = subName.Split(',')[0];
newSubMod.name = subName.Split(',')[0];
InsertNode(newNode, newSubMod, index);
}
else
{
newNode.AddNode(newSubMod);
}
}
else if (command == Command.Paste)
{
Expand Down

0 comments on commit c8ccaa7

Please sign in to comment.