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

Can't add items to the list returned by ship:dockingports [BUG] #3119

Open
nuggreat opened this issue Sep 15, 2024 · 0 comments
Open

Can't add items to the list returned by ship:dockingports [BUG] #3119

nuggreat opened this issue Sep 15, 2024 · 0 comments

Comments

@nuggreat
Copy link

nuggreat commented Sep 15, 2024

When you get the list SHIP:DOCKINGPORTS you can't add items to that list as you get a "specified cast is not valid" error.
Code to reproduce:

SET dl TO SHIP:DOCKINGPORTS.
dl:ADD(0).

There is also an assoceated entry in the KSP log from the C# side of the mod

[LOG 15:29:23.789] System.InvalidCastException: Specified cast is not valid.
  at (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
  at kOS.Safe.Encapsulation.Suffixes.OneArgsSuffix`1[TParam].Call (System.Object[] args) [0x00000] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Encapsulation.Suffixes.DelegateSuffixResult.Invoke (kOS.Safe.Execution.ICpu cpu) [0x00226] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Compilation.OpcodeCall.StaticExecute (kOS.Safe.Execution.ICpu cpu, System.Boolean direct, System.Object destination, System.Boolean calledFromKOSDelegateCall) [0x002b2] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Compilation.OpcodeCall.Execute (kOS.Safe.Execution.ICpu cpu) [0x0000d] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Execution.CPU.ExecuteInstruction (kOS.Safe.Execution.ProgramContext context, System.Boolean doProfiling) [0x00203] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Execution.CPU.ContinueExecution (System.Boolean doProfiling) [0x00040] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 
  at kOS.Safe.Execution.CPU.KOSFixedUpdate (System.Double deltaTime) [0x000b0] in <44fd6c0ba1d84aeaa0b357d09ee83648>:0 

which combined with the lack of verbosity makes me thing this is a C# problem getting back into kerboScript some what similar to issue #3006

There is a simple work around where one simply creates a new list of there own and populates it with everything from the dockingports list but that should not be necessary.

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

No branches or pull requests

1 participant