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

Inconsistent sort behavior in UpdateNeighboringVessels #369

Open
JonnyOThan opened this issue Nov 12, 2023 · 1 comment
Open

Inconsistent sort behavior in UpdateNeighboringVessels #369

JonnyOThan opened this issue Nov 12, 2023 · 1 comment
Labels

Comments

@JonnyOThan
Copy link
Collaborator

KSP.txt

[ERR 18:31:37.302] [MASFlightComputer] System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'AvionicsSystems.MASFlightComputerProxy+VesselDistanceComparer'.
at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer (System.Object comparer) [0x0000b] in <9577ac7a62ef43179789031239ba8798>:0
at System.Collections.Generic.ArraySortHelper1[T].Sort (T[] keys, System.Int32 index, System.Int32 length, System.Collections.Generic.IComparer1[T] comparer) [0x00022] in <9577ac7a62ef43179789031239ba8798>:0
at System.Array.Sort[T] (T[] array, System.Int32 index, System.Int32 length, System.Collections.Generic.IComparer1[T] comparer) [0x00048] in <9577ac7a62ef43179789031239ba8798>:0 at System.Array.Sort[T] (T[] array, System.Collections.Generic.IComparer1[T] comparer) [0x0000e] in <9577ac7a62ef43179789031239ba8798>:0
at AvionicsSystems.MASFlightComputerProxy.UpdateNeighboringVessels () [0x000f3] in :0
at AvionicsSystems.MASFlightComputerProxy.TargetVesselName (System.Double id) [0x00000] in :0
at (wrapper dynamic-method) AvionicsSystems.DynamicMethodFactory.(object,double)
at (wrapper delegate-invoke) System.Func`3[System.Object,System.Double,System.String].invoke_TResult_T1_T2(object,double)
at AvionicsSystems.MASFlightComputer+<>c__DisplayClass70_2.b__1 () [0x00023] in :0
at AvionicsSystems.StringVariable.Evaluate (System.Boolean invokeCallbacks) [0x00019] in :0
at AvionicsSystems.MASFlightComputer.FixedUpdate () [0x00395] in :0

[ERR 18:31:37.302] [MASFlightComputer] FixedUpdate exception on variable (fc.TargetVesselName)(6):

[ERR 18:31:37.303] [MASFlightComputer] System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'AvionicsSystems.MASFlightComputerProxy+VesselDistanceComparer'.
at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer (System.Object comparer) [0x0000b] in <9577ac7a62ef43179789031239ba8798>:0
at System.Collections.Generic.ArraySortHelper1[T].Sort (T[] keys, System.Int32 index, System.Int32 length, System.Collections.Generic.IComparer1[T] comparer) [0x00022] in <9577ac7a62ef43179789031239ba8798>:0
at System.Array.Sort[T] (T[] array, System.Int32 index, System.Int32 length, System.Collections.Generic.IComparer1[T] comparer) [0x00048] in <9577ac7a62ef43179789031239ba8798>:0 at System.Array.Sort[T] (T[] array, System.Collections.Generic.IComparer1[T] comparer) [0x0000e] in <9577ac7a62ef43179789031239ba8798>:0
at AvionicsSystems.MASFlightComputerProxy.UpdateNeighboringVessels () [0x000f3] in :0
at AvionicsSystems.MASFlightComputerProxy.TargetVesselName (System.Double id) [0x00000] in :0
at (wrapper dynamic-method) AvionicsSystems.DynamicMethodFactory.(object,double)
at (wrapper delegate-invoke) System.Func`3[System.Object,System.Double,System.String].invoke_TResult_T1_T2(object,double)
at AvionicsSystems.MASFlightComputer+<>c__DisplayClass70_2.b__1 () [0x00023] in :0
at AvionicsSystems.StringVariable.Evaluate (System.Boolean invokeCallbacks) [0x00019] in :0
at AvionicsSystems.MASFlightComputer.FixedUpdate () [0x00395] in :0

@JonnyOThan
Copy link
Collaborator Author

caused by

return (int)(distA - distB);

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

No branches or pull requests

1 participant