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

Unable to use negative indices in Array.remove #46947

Open
abelgutierrez99 opened this issue Mar 12, 2021 · 1 comment · May be fixed by #83027
Open

Unable to use negative indices in Array.remove #46947

abelgutierrez99 opened this issue Mar 12, 2021 · 1 comment · May be fixed by #83027

Comments

@abelgutierrez99
Copy link

Godot version: 3.2.3

OS/device including version: Windows 10 x 64

Issue description:
When you create an Array and later use Array.remove(index), index must be positive, althouth Arrays can be indexed using negative indices. The debugger message in the minimal reproduction project is: E 0:00:00.895 remove: Index p_index = -1 is out of bounds (size() = 3). <C++ Source> ./core/cowdata.h:161 @ remove() Spatial.gd:7 @ _ready()

Maybe other methods have the same problem.

Steps to reproduce:
Create an Array and try to remove one element using a negative index with Array.remove

Minimal reproduction project:

Github.zip

@Calinou
Copy link
Member

Calinou commented Mar 12, 2021

This needs to be implemented. See also #37209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants