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

/forcedrop only drops about half the items when there are multiple of said item. #1

Open
PhaserArray opened this issue Oct 13, 2017 · 1 comment · May be fixed by #2
Open

/forcedrop only drops about half the items when there are multiple of said item. #1

PhaserArray opened this issue Oct 13, 2017 · 1 comment · May be fixed by #2

Comments

@PhaserArray
Copy link

As an example, give yourself 10 scrap metal and force drop it, only 5 will be dropped.

I believe there's a simple fix to it. Do not iterate over the indices in a page front to back as you are removing items from the list and the indexes will change. Instead, iterate over the items in reverse with for (byte index = count - 1; index >= 0 ; index--) instead of the current for (byte index = 0; index < count; index++).

@PhaserArray PhaserArray linked a pull request Oct 17, 2017 that will close this issue
@Miha22
Copy link

Miha22 commented Jun 11, 2019

check out my fork, I have fixed that.

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

Successfully merging a pull request may close this issue.

2 participants