EngineHub / CommandHelper

Rapid scripting and command aliases for Minecraft owners
https://methodscript.com
Other
119 stars 71 forks source link

ba_get_bytes() (always?) returns a zero-size byte_array #1335

Closed Pieter12345 closed 1 year ago

Pieter12345 commented 1 year ago

Code:

@ba = byte_array(); for(@i = 0, @i < 100, @i++) {ba_put_byte(@ba, 1);} @ba2 = ba_get_bytes(@ba, 10, 10); msg(array_size
(@ba).' - '.array_size(@ba2));

Results in:

100 - 0

The expected behavior is that the subarray from indices 10 to 20 is assigned to @ba2, making its size 10 instead of 0. Tested on build 282.