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

Incorrect sequence of calling callbacks on_take & on_put on swapping items in inventory #13486

Closed
alek13 opened this issue May 7, 2023 · 1 comment · Fixed by #12595
Closed
Labels
Bug Issues that were confirmed to be a bug @ Server / Client / Env.

Comments

@alek13
Copy link
Contributor

alek13 commented May 7, 2023

Minetest version
5.7.0
OS / Hardware

Operating system: Kubuntu 22.04.2 LTS

Summary

When swapping items in inventory, MT calls:

  • at first on_put
  • and then on_take

It will be better if MT calls it in reverse order:

  • on_take
  • on_put
Steps to reproduce

For example, with LOTT game:

  1. Install LOTT
    • also you can add debug prints into log here
  2. Open inventory, creative tab, search&take "Mithril boots" and "Training boots"
  3. Open Main tab and put on Mithril one
  4. Take wooden Training one and swap it with Mithril

As result:

  • you have no boots on preview in inventory
  • you have no boots on player model (F7)
  • and also you have no protection
    image
@SmallJoker
Copy link
Member

PR already exists but waits on another PR which waits for its author #12595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Server / Client / Env.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants