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

WebAdmin: Fix off-by-one area errors #68

Open
madmaxoft opened this issue Nov 19, 2019 · 1 comment
Open

WebAdmin: Fix off-by-one area errors #68

madmaxoft opened this issue Nov 19, 2019 · 1 comment

Comments

@madmaxoft
Copy link
Member

In the webadmin pages "Latest claims" and "Latest changes", the images for the areas seem to have an off-by-one problem, usually exporting the whole 256-block-high area and a part of the sidewalk rather than just the changes.
image

@madmaxoft
Copy link
Member Author

The root of the problem is that the plugin is trying to export too large an area as the image. Instead of exporting only the bounding-box of the changed voxels, it exports the entire gallery area, including the ~180 air blocks above any build and all the way down to the bedrock layer.
The original idea for the export coords is as follows:

  1. If the area has a user-defined bounding box (as maintained in the shared DB by the GalExport plugin), use that.
  2. If not, use the stored min and max coords of the edits (each block placement and removal should update these).
  3. If not (for areas created before the edit-tracking code), calculate the diff of the area with the original area data (as set in the gallery's template schematic)
    It seems part of this decision code is missing, and the third step has the off-by-one problem when diffing.

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