List resolving to MemorySafeList when no alternative is found

Jouster500 shared this bug 5 months ago
Solved

What is the subject of your issue?: Scripting/ModAPI changes

When did this issue first occur?: May 2nd, 2025, version 1.206.030

Has this issue occurred in the past?: No. This script has worked in previous versions as far back as November 30th of 2020.

Describe the issue:


In a script of mine (attached as a text), I receive the following error when compiling;

Program(1004, 72): Error: Argument 1: cannot convert from 'Sandbox.ModAPI.Ingame.IMyShipController' to 'Program.dir
'Program(1004, 85): Error: Argument 3: cannot convert from 'System.Collections.Generic.List<Program.BlockHandle<T>>' to 'int'
According to the recent patch on May 2nd, 2025, a change was made that changed list behind the scenes to point to MemorySafeList instead. In the following code segment;


// This will attempt to parse out the various versions of enact
public virtual void enact(IMyShipController ctrl, int group, List<Object> list) {
    if (list is List<BlockHandle<T>>) {
            enact(ctrl, group, list as List<BlockHandle<T>>);
    }
}
/** To be overrided */
public void enact(IMyShipController ctrl, int group, List<BlockHandle<T>> list) { }


It appears that List behind the scenes is converted to MemorySafeList. But in this case, it doesnt know how to map `new MemorySafeList<Object>` and is stuck at the first instance of enact. Changing the `List` to `MemorySafeList` of the shared section does allow the code to compile.

Replies (2)

photo
1

Hello Engineer,

Thank you for reaching our forum and letting us know about this issue.

We have added this issue into our internal system.

Kind Regards,

Keen Software House: QA Department

photo
1

Hello Engineer,

We would like to inform you that the issue you reported has been fixed in the 1.207 (Apex Survival) update.

If you encounter any other problems, please don’t hesitate to create a new thread.

I’ll now close this one as solved.


Kind Regards,

Ludmila Danilchenko

Head of Space Engineers QA Department

Leave a Comment
 
Attach a file