Skip to content

Fix item duplication on containers with more items than cap - #1126

Merged
mehah merged 2 commits into
opentibiabr:mainfrom
Kamenuvol:main
Apr 4, 2025
Merged

Fix item duplication on containers with more items than cap#1126
mehah merged 2 commits into
opentibiabr:mainfrom
Kamenuvol:main

Conversation

@Kamenuvol

Copy link
Copy Markdown
Contributor

Description

If there is a container without pagination and more items than its capacity, the last item is duplicated when removing items. This commit fixes it and also make Container::addItem more symmetric with Container::removeItem.

Behavior

Actual

Add more items to a container than its capacity. Different items to see better the difference.
Remove any of them until when you would had an empty space, but there will be no empty space, just a duplicated last item.
image

Expected

Only one last item (skull staff)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

If there is a container without pagination and more items than its capacity, the last item is duplicated when removing items.

This commit fixes it and also make Container::addItem more symmetric with Container::removeItem.
@sonarqubecloud

Copy link
Copy Markdown

@mehah
mehah requested a review from kokekanon March 24, 2025 21:43
@kokekanon

Copy link
Copy Markdown
Contributor

I can't reproduce the error that this PR is trying to fix. Also, I see that you're using release 3.5.

i test in main repo
canary 11.00

player knight cap 1065, level 69
bag client id : 2854 "backpack" 20 slot
image

Can you be more clear, the steps to reproduce the error?

@Kamenuvol

Copy link
Copy Markdown
Contributor Author

I can't reproduce the error that this PR is trying to fix. Also, I see that you're using release 3.5.

i test in main repo canary 11.00

player knight cap 1065, level 69 bag client id : 2854 "backpack" 20 slot image

Can you be more clear, the steps to reproduce the error?

A backpack, for example, has 20 spaces, fill it with 21 items forcing using flag, then remove the items.

@mehah
mehah merged commit 44c3cb2 into opentibiabr:main Apr 4, 2025
vllsystems pushed a commit to vllsystems/otclient that referenced this pull request Apr 4, 2025
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 this pull request may close these issues.

3 participants