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 OnItemMoved event when the last item of a stackable stack is move… #3918

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

Erza
Copy link
Contributor

@Erza Erza commented Jan 31, 2022

…d into another stack

Pull Request Prelude

Changes Proposed

Followup to #3916
A crash would occur when moving, for example, a stack of a single gold coin into another stack of gold coins.
The crash would only occur when the last item of a stack was being moved, aka. the stack being destroyed.

Old output of this scenario:

New output of this scenario:

==========================
=== Player:onItemMoved ===
==========================
{
    ["toCylinder"] = userdata: 0x06b4fc80,
    ["fromCylinder"] = userdata: 0x06b4fc58,
    ["count"] = 5,
    ["toPosition"] = {
        ["y"] = 64,
        ["x"] = 65535,
        ["z"] = 0,
        ["stackpos"] = 0
    },
    ["item"] = {
        ["type"] = 100,
        ["itemid"] = 2148,
        ["uid"] = 65544,
        ["actionid"] = 0
    },
    ["fromPosition"] = {
        ["y"] = 66,
        ["x"] = 65535,
        ["z"] = 1,
        ["stackpos"] = 0
    }
}
==========================

Issues addressed:

@EPuncker EPuncker requested review from a team January 31, 2022 08:05
Copy link
Member

@Znote Znote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced crash:
itemcrash1

Applied this PR, crash fixed:
itemcrash2

Ohh yeah, I'm rocking OTClient with Protocol 12 😎

@Znote Znote merged commit b238500 into otland:master Jan 31, 2022
Znote pushed a commit to Znote/forgottenserver that referenced this pull request Feb 23, 2022
…d into another stack (otland#3918)

A crash would occur when moving, for example, a stack of a single gold coin into another stack of gold coins.
The crash would only occur when the last item of a stack was being moved, aka. the stack being destroyed.
DSpeichert pushed a commit that referenced this pull request May 9, 2022
…d into another stack (#3918)

A crash would occur when moving, for example, a stack of a single gold coin into another stack of gold coins.
The crash would only occur when the last item of a stack was being moved, aka. the stack being destroyed.
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.

3 participants