Skip to content

Commit

Permalink
Re-inline saveBodyData
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 2, 2014
1 parent ec63cf4 commit a44b423
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Plugin/KethaneData.cs
Expand Up @@ -158,7 +158,9 @@ public override void OnSave(ConfigNode configNode)

foreach (var body in resource.Value)
{
var bodyNode = saveBodyData(body.Key, body.Value);
var bodyNode = new ConfigNode("Body");
bodyNode.AddValue("Name", body.Key);
body.Value.Save(bodyNode);
resourceNode.AddNode(bodyNode);
}

Expand All @@ -168,13 +170,5 @@ public override void OnSave(ConfigNode configNode)
timer.Stop();
Debug.LogWarning(String.Format("Kethane deposits saved ({0}ms)", timer.ElapsedMilliseconds));
}

private ConfigNode saveBodyData(string bodyName, BodyResourceData bodyResources)
{
var bodyNode = new ConfigNode("Body");
bodyNode.AddValue("Name", bodyName);
bodyResources.Save(bodyNode);
return bodyNode;
}
}
}

0 comments on commit a44b423

Please sign in to comment.