minetest-mods / areas

A rewrite of the node_ownership Minetest mod with many new features.
GNU Lesser General Public License v2.1
51 stars 52 forks source link

Use smallest area at given position #79

Closed SwissalpS closed 2 months ago

SwissalpS commented 2 months ago

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: https://github.com/mt-mods/xp_redo/pull/74

SwissalpS commented 2 months ago

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 commented 2 months ago

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

SwissalpS commented 2 months ago

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 commented 2 months ago

suggested setting name: use_smallest_area_precedence any ideas for something shorter?