-
-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Labels
area-API-SchemaSystemRelated to the Source 2 Schema SystemRelated to the Source 2 Schema System
Milestone
Description
The current workaround is this:
public unsafe T[] GetFixedArray<T>(nint pointer, string @class, string member, int length) where T: NativeObject
{
nint ptr = pointer + Schema.GetSchemaOffset(@class, member);
Span<nint> references = MemoryMarshal.CreateSpan<nint>(ref ptr, length);
T[] values = new T[length];
for (int i = 0; i < length; i++)
{
values[i] = (T)Activator.CreateInstance(typeof(T), references[i])!;
}
return values;
}
this works in general and can access the whole schemaclass but when I messed with viewmodels I've experienced a segfault when tried to access the animation? string and it was corrupted memory but haven't investigated further yet but this needs attention for sure.
I might take on this just to dont forget about the issue in general I've opened this
Metadata
Metadata
Assignees
Labels
area-API-SchemaSystemRelated to the Source 2 Schema SystemRelated to the Source 2 Schema System