Skip to content

Conversation

@Starstrider42
Copy link
Contributor

I found out the hard way that the orbit property no longer exists, and CelestialBody.GetOrbit() is broken as of 0.24.2. GetOrbitDriver() is still usable, though.

I found out the hard way that the orbit property no longer exists, and CelestialBody.GetOrbit() is broken as of 0.24.2. GetOrbitDriver() is still usable, though.
@Anatid
Copy link
Owner

Anatid commented Sep 20, 2014

Are you sure about CelestialBody.GetOrbit()? I'm pretty sure we use it in MechJeb and I haven't noticed it breaking.

@Starstrider42
Copy link
Contributor Author

I think so... I ran into the issue while experimenting with some Custom Asteroids code. It's possible that the NRE only happens with the Sun (where GetOrbitDriver() returns null, while GetOrbit() throws as described), but whatever the details it's definitely less stable than GetOrbitDriver().

@tomforwood
Copy link

I have just tested
CelestialBody sun = Planetarium.fetch.Sun;
CelestialBody kerbin = sun.orbitingBodies.Where(cb => cb.name == "Kerbin").First();
Log("Kerbin orbit="+kerbin.orbit);
Log("Kerbin orbit=" + kerbin.GetOrbit());
and it looks to be producing sensible values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants