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

Object reference not set to an instance of an object when calculating interpolations #25

Closed
Lothsahn opened this issue Nov 6, 2016 · 2 comments

Comments

@Lothsahn
Copy link
Contributor

Lothsahn commented Nov 6, 2016

"System.NullReferenceException: Object reference not set to an instance of an object
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.GetInterpolatedAcceleration (Single interpolationValue) [0x00020] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:449
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.ApplySurfaceInterpolation (Single interpolationValue) [0x00001] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:398
at LunaClient.Systems.VesselUpdateSys.VesselUpdate.ApplyInterpolations (Single percentage) [0x00033] in C:\shared\kerbal space program\LunaMultiPlayer\Client\Systems\VesselUpdateSys\VesselUpdate.cs:353 "

Breakpointing on VesselUpdate:449, I found that the Target.Acceleration was null, but the Target was valid. I'm not sure what the conditions are for a target to have or not have an acceleration.

@Lothsahn
Copy link
Contributor Author

Lothsahn commented Nov 6, 2016

This occurs when we are targeting an entity which provides an Orbital update. Orbital updates do not set acceleration, but instead set Orbit (see VesselUpdateMessageHandler.cs), which means that you get a NullReference exception inside VesselUpdate when it attempts to apply a surface interpolation but the target is providing orbital coordinates.

This explains why Target.Acceleration is null. Target.Orbit does contain information, but Target.Acceleration does not.

@gavazquez
Copy link
Member

Being worked on. closing the bug until vessel updater is finished

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

No branches or pull requests

2 participants