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 crash if bones punched by non-player #3146

Merged
merged 5 commits into from
Aug 18, 2024
Merged

Conversation

berengma
Copy link
Contributor

  • Added check for player:is_player()
  • if bones are fresh and the bones are punched nothing happens
  • if bones are old, the inventory is dropped as entities and the bones node is removed

Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

Works. Tested with the code in #3145 (comment).

mods/bones/init.lua Outdated Show resolved Hide resolved
mods/bones/init.lua Outdated Show resolved Hide resolved
mods/bones/init.lua Outdated Show resolved Hide resolved
mods/bones/init.lua Outdated Show resolved Hide resolved
@berengma
Copy link
Contributor Author

berengma commented Aug 3, 2024

Updated PR according to code style guidelines

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Tested using SmallJoker's code by setting the bone share time to a few seconds, then /killme, then /p (nothing happens, bones are still fresh), then after a few seconds /p again (items are dropped).

@berengma
Copy link
Contributor Author

Anyone who could do a second review ?

Copy link
Contributor Author

@berengma berengma left a comment

Choose a reason for hiding this comment

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

from my point everything is resolved

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
mods/bones/init.lua Outdated Show resolved Hide resolved
@sfan5 sfan5 changed the title fix issue #3145 - bones mod Fix crash if bones punched by non-player Aug 18, 2024
@sfan5 sfan5 merged commit 4e402ec into minetest:master Aug 18, 2024
2 checks passed
MoNTE48 pushed a commit to MoNTE48/minetest_game that referenced this pull request Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: mod bones - server crash when use 'minetest.punch_node()' from any mod
5 participants