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

Use smallest area at given position #79

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

SwissalpS
Copy link
Contributor

When checking for permission to interact, currently the smallest id takes precedence in a situation where areas enclose other areas. This makes it complicated to set up private areas within faction areas and vice versa. Same applies for open areas within a bigger private area.

When multiple areas have the same volume, players seem to agree that the most recently protected area should also take precedence.
Since we can't guarantee that the largest id is the most recent, we still use that info as we have no other way to determine age.

In this PR the smallest area is determined and protection checks applied to that one.

Example usage: mt-mods/xp_redo#74

api.lua Outdated Show resolved Hide resolved
api.lua Outdated Show resolved Hide resolved
api.lua Show resolved Hide resolved
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.

Large protected area, small open area: Digging inside is possible.
Large open area, small protected area: Digging inside is prohibited.

Works as intended. I'll merge this PR in a few days unless there are objections.

@SmallJoker SmallJoker merged commit c2e3d07 into minetest-mods:master Sep 11, 2024
1 check passed
@SwissalpS
Copy link
Contributor Author

This was a premature PR on my part. Probably better to revert this one until we come up with a way to convert existing areas automatically. Some players are confused with the new paradigm.

@SmallJoker
Copy link
Member

@SwissalpS In this case it could be changed to a setting - preferably disabled for existing worlds and enabled by default for new ones.

@SwissalpS
Copy link
Contributor Author

the method getSmallestAreaAtPosition could be kept whichever way we proceed.
I'll look into it, though probably not tonight or tomorrow, we have a planned blackout comming up...

@SwissalpS
Copy link
Contributor Author

suggested setting name: use_smallest_area_precedence
any ideas for something shorter?

SmallJoker pushed a commit that referenced this pull request Oct 1, 2024
This restores the behaviour to before #79.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants