neuoy / KSPTrajectories

A Kerbal Space Program mod to display trajectory predictions, accounting for atmospheric drag, lift, etc.
GNU General Public License v3.0
143 stars 47 forks source link

Divide by zero exception spam #184

Closed dtoxic47 closed 2 years ago

dtoxic47 commented 2 years ago

This happened when i was doing some testing (not related to this mod) so i cheat my self into laythe orbit (was fixing some SVE clouds and stuff) then i reverted back to VAB made a simple rocket launched it and then the nullrefs started spamming,this does not happen when i launch a fresh game and i don't teleport to other planets as far as i can tell

PS. i noticed that some lines in the config.xml have a setting set to zero,i might be related to a problem smoke screen mod was having the "ZERO" in the settings was causing problems,maybe this is the case here also,just a thought

https://forum.kerbalspaceprogram.com/index.php?/topic/64987-18x-110x-smokescreen-2814-extended-fx-plugin-18-april-2020/&do=findComment&comment=3526423

[EXC 22:52:51.189] DivideByZeroException: Attempted to divide by zero. Trajectories.Trajectory+d48.MoveNext () (at :0) Trajectories.Trajectory+d39.MoveNext () (at :0) Trajectories.Trajectory.ComputeTrajectory () (at :0) Trajectories.Trajectory.Update () (at :0) Trajectories.Trajectories.Update () (at :0) UnityEngine.DebugLogHandler:LogException(Exception, Object) ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object) UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

and so it goes until returning to VAB

PiezPiedPy commented 2 years ago

I'll take a look, I'm assuming it will be a trivial fix, probably nothing more than to check a divisor is not zero, computers cant divide by zero, it freaks them out 🤨

But this error might also be due to a problem earlier in the code, as the problem seems to be a value is zero when it should not be.

dtoxic47 commented 2 years ago

thx for taking a look

PiezPiedPy commented 2 years ago

@sick13 I've tried to reproduce the exception but have had no luck, any you chance you could install this debug version and post your ksp.log when you encounter the bug.

TrajectoriesDebug-v2.4.4.zip

dtoxic47 commented 2 years ago

Will do,tonight or tomorrow as i am not at home currently,will let you know what i find if anything

dtoxic47 commented 2 years ago

so i tried the debug version,and can't get it to spam,then i used the release version and weirdly enough that one also works now,maybe a particular part of a mod could be responsible for this? i cant remember exactly what kind of rocket i slapped together that time i was testing stuff out...ill keep trying and see if i can get it to spam and ill post the logs