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 corals and kelps duping with mesecons' sticky piston #3062

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

zmv7
Copy link
Contributor

@zmv7 zmv7 commented Sep 14, 2023

This pull request fixes a glitch/exploit that could be used to dupe default:coral_skeleton and default:sand nodes infinitely.

Before patch

Place mesecons' sticky piston next to cyan/green/pink coral or default:sand_with_kelp and switch the piston couple times. In the result, extra default:coral_skeleton or default:sand node will appear on each piston retraction.

After patch

The cyan/green/pink corals and default:sand_with_kelp are moving by piston normally, without creating extra nodes.

screenshot1
screenshot2

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.

after_destruct is called by minetest.remove_node. This is indeed wrong - when a mod wants to remove a node, that node shouldn't turn into sand; it is reasonable for the sand and the kelp attached to it to be gone.

Using after_dig_node instead makes more sense. You don't have to add unused parameters though.

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

LGTM

@appgurueu appgurueu merged commit eba9012 into minetest:master Sep 16, 2023
1 check passed
MoNTE48 pushed a commit to MoNTE48/minetest_game that referenced this pull request Oct 8, 2023
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.

3 participants