Fix World not handling args correctly

main
copygirl 2 years ago
parent 9eade0adb1
commit 5264ffdc5f
  1. 9
      src/gaemstone.ECS/World+Bare.cs

@ -27,7 +27,14 @@ public unsafe struct World
api.abort_ = new FnPtr_Void { Pointer = &Abort }; api.abort_ = new FnPtr_Void { Pointer = &Abort };
ecs_os_set_api(&api); ecs_os_set_api(&api);
Handle = ecs_init_w_args(args.Length, null); if (args?.Length > 0) {
var ptr = Runtime.CStrings.CStringArray(args);
Handle = ecs_init_w_args(args.Length, ptr);
for (var i = 0; i < args.Length; i++)
Marshal.FreeHGlobal(ptr[i]);
} else {
Handle = ecs_init();
}
} }
public bool Progress(TimeSpan delta) public bool Progress(TimeSpan delta)

Loading…
Cancel
Save