Jump to content

[KSP 1.5] Problems with Stage Icons in mod (Support from KSP Devs is needed)


Recommended Posts

Hi!

I belong to the BDArmory team. I was doing some tests on KSP 1.5 yesterday and I have found some issues. We have some code for weapons that creates stage icons for weapons. However an Exception is raised in KSP 1.5. I would like to have some feedback from KSP dev team regarding this. I will attach the code that I think may be causing this.

Exception log:

EXC 20:43:43.716] ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
    System.Collections.Generic.List`1[KSP.UI.Screens.StageGroup].get_Item (Int32 index)
    KSP.UI.Screens.StageManager.AddHeldIconsToStages (.Part selectedPart, Boolean switchingVessels)
    KSP.UI.Screens.StageManager.SortIconsSequence (.Part p, Boolean switchingVessels)
    KSP.UI.Screens.StageManager+<SortIconsSequence>c__Iterator0.MoveNext ()
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
 

My feeling with the  ArgumentOutOfRangeException is that the code is iterating through a stagegroup icon list however is accounting for more icons than the icons that are actually in the list.

My question for the devs is:

¿Has something changed between 1.4.5 and 1.5 releases in regards of StageManager class and the way the stage icons are managed?

Here you can see the code we are using to create the icon, this has been working fine until KSP 1.5.

https://github.com/PapaJoesSoup/BDArmory/blob/master/BDArmory/Modules/ModuleWeapon.cs#L773



if (part.stackIcon.StageIcon == null)
{
	part.stackIcon.CreateIcon();
}

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...