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

Residence containsLoc - parent why? #109

Open
aikar opened this issue Aug 21, 2015 · 1 comment
Open

Residence containsLoc - parent why? #109

aikar opened this issue Aug 21, 2015 · 1 comment

Comments

@aikar
Copy link

aikar commented Aug 21, 2015

https://github.com/bekvon/Residence/blob/master/src/com/bekvon/bukkit/residence/protection/ClaimedResidence.java#L466-L476

Why does the code check the parent for containsLoc? I don't see why that check is beneficial at all, and all subzones are guaranteed to be inside of the parents areas anyways, so why?

@aikar
Copy link
Author

aikar commented Aug 21, 2015

Discussed it with another one of my devs. the case we can see is if you have 2 areas that say creates a T shape.

You can then create a subzone where high point is say in the top left of the T, and the low point is in the base of the T.

this results in the subzone now escaping the parent residences area...

Pretty tricky situation :/

So this check makes Residence ignore that area that escapes the parent.

So this results in some pretty weird shaped subzone areas (L shaped in the case of the T scenario), a non cuboid area, as part of the cuboid is 'ignored' for not being in the parent.

So I guess yes it is needed, but we will personally be ensuring subzone creation is blocked if it leaks outside of the parent, then we will remove that check to simplify the check.

Picture to better show it: https://i.imgur.com/3d6T6CP.png

Red = Parent res. Blue/Purple = 2 diff areas. Area addition checks if the new area high and low is contained in the parent, which it will pass.

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

No branches or pull requests

1 participant