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

Fix trade stacking items #3248

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Conversation

nekiro
Copy link
Member

@nekiro nekiro commented Dec 25, 2020

I'm not entirely sure why this code is there, but this breaks passing FLAG_IGNOREAUTOSTACK (and probably other flags too) for trading and any other internalMoveItem that is not moved in single queryDestination execute.
I think it's probably, because Tile::queryDestination can add "FLAG_NOLIMIT" to flags

Here is the explanation behind this "flags = 0;" code
In trade item is moved to player, so it queries two cylinders, first one is player, second one is his backpack to which item is moved, querying player deletes flag "flags = 0", so second query stacks the item, because flags is 0 at this point and it merges two same stackable items in trade which results in whole stack on one side.

@MillhioreBT
Copy link
Contributor

Interesting, I have noticed inconsistencies, when moving articles in which several cylinders must be verified, this could be the cause, but I will still review it more thoroughly, and do tests

@nekiro nekiro added the bugfix label Dec 28, 2020
@DSpeichert
Copy link
Member

@MillhioreBT any news on tests?

@DSpeichert DSpeichert merged commit ce08b28 into otland:master Feb 14, 2022
@nekiro nekiro deleted the fix-trade-stacking branch February 14, 2022 09:48
Znote pushed a commit to Znote/forgottenserver that referenced this pull request Feb 23, 2022
DSpeichert pushed a commit that referenced this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants