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

onDeEquip properly handled at logout/death #4664

Merged
merged 1 commit into from
May 1, 2024

Conversation

EvilHero90
Copy link
Contributor

Pull Request Prelude

Changes Proposed

We didn't deequip items on logout/death but we equip everytime the player login.
That way onDeEquip didn't work correctly as intended.
following example code shows what the problem is:

function onEquip(player, item, slot)
    player:setMaxHealth(player:getMaxHealth() + 100)
    return true
end

function onDeEquip(player, item, slot)
    player:setMaxHealth(player:getMaxHealth() - 100)
    return true
end

The above would have resulted on every logout/login that the HP would increase by 100 but not decrease on logout/death
which is now fixed

Issues addressed:
none

We didn't deequip items on logout/death that way onPlayerDeEquip didn't correctly work as intended
@nekiro
Copy link
Member

nekiro commented May 1, 2024

It honestly doesn't matter, as long as the player object is deleted anyway and none of the equip stuff are persistent. Nonetheless doesn't hurt to add this.

@MillhioreBT MillhioreBT merged commit 4558f1d into otland:master May 1, 2024
19 checks passed
@MillhioreBT
Copy link
Contributor

MillhioreBT commented May 1, 2024

Thanks for noticing, I added the notification at the beginning of the login and completely forgot about the logout/death

@EvilHero90 EvilHero90 deleted the deequip-fix branch May 1, 2024 16:07
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