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

Three unrelated commits for your consideration #2

Closed CiaranG closed 10 years ago

CiaranG commented 10 years ago

Regarding the extra api function, I'm using this mod for several things other than protection, as it provides a useful way to 'mark up' positions and locations for use by other mods. Whether that fits in with your intended usage for the mod I don't know.

ShadowNinja commented 10 years ago

I've added the first and third patches. The second checks which area's center is closest to you, rather than counting the edges too, which I think is the expected result. It may be very difficult to implement this whole-area checking though. Annother issue with the second patch is that the pattern lowering method makes it impossible to match areas with capital letters, as the name is not lowered. I think it would be better for it to return the closest areas without doing name matching. That way the caller can run any additional filters on the list that it wants, and can use case-sensitive name matching.

CiaranG commented 10 years ago

The nearest centre is my expected result, although I guess that's not made clear in the documentation, and may not be what someone else would want from it.

The pattern "lowering" method though, is not that at all - look again - it makes the pattern case insensitive as documented, so it's possible to match areas with capital letters or without. I can't really imagine why a a case sensitive search would be required.

ShadowNinja commented 10 years ago

Oh, so it is. Oops. I still think that the pattern matching should be done by the caller if it needs it though. Oh, and "centre" -> "center".

CiaranG commented 10 years ago

Definitely centre. ;)

Ok, I think we should just skip this one then. I'll close this request and do any future ones from a feature branch.