Skip to content
This repository has been archived by the owner on Aug 9, 2018. It is now read-only.

[Bug] Config for GasPlanet Rings isn't used #13

Open
MartinX3 opened this issue Aug 7, 2017 · 0 comments
Open

[Bug] Config for GasPlanet Rings isn't used #13

MartinX3 opened this issue Aug 7, 2017 · 0 comments

Comments

@MartinX3
Copy link
Contributor

MartinX3 commented Aug 7, 2017

var data = Random.Choose(ringDatatbase.nodes);
Gets the correct string from the config file.

var def = Parser.CreateObjectFromConfigNode(data);
Delievers only standard values (0/true);
Somewhere in the Parser.cs Reflection-Code is a bug.

File Generator.cs

if (planet.gas_giant && (Random.Next(0, 100) < 5))
            {
                var rings = new ConfigNode("Rings");
                node.AddConfigNode(rings);
                var ringDatatbase = Utility.Load("rings");
                var data = Random.Choose(ringDatatbase.nodes);
                var def = Parser.CreateObjectFromConfigNode<RingPrefab>(data);
                foreach (var r in def.Rings)
                {
                    var ring = new ConfigNode("Ring");
                    rings.AddConfigNode(ring);
                    ring.AddValue("innerRadius", "" + (planet.radius * 0.1 * r.InnerRadius));
                    ring.AddValue("outerRadius", "" + (planet.radius * 0.1 * r.OuterRadius));
                    ring.AddValue("angle", "" + r.Angle);
                    ring.AddValue("color", Parser.WriteColor(Utility.AlterColor(planetColor)));
                    ring.AddValue("lockRotation", "" + r.LockRotation);
                    ring.AddValue("unlit", "False");
                }

                // Log
                Console.WriteLine($"Generated rings around {name}");
 }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant