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

Clicking a building through the region menu will show its boundaries centered around you, even if you're not inside of it #167

Open
JotaFaD opened this issue Sep 26, 2020 · 1 comment

Comments

@JotaFaD
Copy link
Collaborator

JotaFaD commented Sep 26, 2020

Steps to reproduce:

  1. Go outside any of your buildings' boundaries
  2. Right click Civs' book
  3. Click on Regions
  4. Click on any building

You should now have the boundaries of that region centered around you.

Also, if the player is inside any building, but select another one in the regions' menu, Civs will show the boundaries of the building the player clicked, but centered around the chest of the building the player is into.

@JotaFaD
Copy link
Collaborator Author

JotaFaD commented Oct 7, 2020

Most likely caused by this bit of code. This should check that the player is inside the region this menu represents before displaying the bounding box.

if (player != null && !StructureUtil.hasBoundingBoxShown(civilian.getUuid())) {
Region r = RegionManager.getInstance().getRegionAt(player.getLocation());
RegionType regionType = (RegionType) ItemManager.getInstance().getItemType(region.getType());
boolean infiniteBoundingBox = params.containsKey(Constants.INFINITE_BOUNDING_BOX);
if (r == null) {
StructureUtil.showGuideBoundingBox(player, player.getLocation(), regionType, infiniteBoundingBox);
} else {
StructureUtil.showGuideBoundingBox(player, r.getLocation(), regionType, infiniteBoundingBox);
}
}

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