Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CelestialBody.GetOrbit() #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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