Fix error with nodes added by the game

This commit is contained in:
Andrew Cassidy 2020-06-26 20:58:17 -07:00
parent 473eca57af
commit 52a0030b5e
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1
2 changed files with 3 additions and 9 deletions

View File

@ -35,11 +35,6 @@ namespace Restock
case "COPYROTATIONCONSTRAINT":
constraints.Add(new CopyRotationConstraint(cnode, this.part));
break;
//Unknown
default:
this.LogError($"Unknown constraint type \"{cnode.name}\"");
break;
}
}
@ -52,13 +47,12 @@ namespace Restock
{
if (constraints == null || constraints.Count == 0)
{
ConfigNode cfg;
foreach (UrlDir.UrlConfig pNode in GameDatabase.Instance.GetConfigs("PART"))
{
if (pNode.name.Replace("_", ".") == part.partInfo.name)
{
cfg = pNode.config;
ConfigNode node = cfg.GetNodes("MODULE").Single(n => n.GetValue("name") == moduleName);
var cfg = pNode.config;
var node = cfg.GetNodes("MODULE").Single(n => n.GetValue("name") == moduleName);
OnLoad(node);
}
}
@ -66,7 +60,7 @@ namespace Restock
}
}
void LateUpdate()
private void LateUpdate()
{
if (constraints == null) return;