*actually fixed it

This commit is contained in:
boy0001 2015-04-05 14:01:31 +10:00
parent 9195c2271c
commit 7850644ab1

View File

@ -35,8 +35,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
public PlotId getPlotIdAbs(final PlotWorld plotworld, int x, final int y, int z) { public PlotId getPlotIdAbs(final PlotWorld plotworld, int x, final int y, int z) {
final SquarePlotWorld dpw = ((SquarePlotWorld) plotworld); final SquarePlotWorld dpw = ((SquarePlotWorld) plotworld);
int pathWidthLower; int pathWidthLower;
int end;
if (dpw.ROAD_WIDTH == 0) { if (dpw.ROAD_WIDTH == 0) {
pathWidthLower = -1; pathWidthLower = -1;
end = dpw.PLOT_WIDTH;
} }
else { else {
if ((dpw.ROAD_WIDTH % 2) == 0) { if ((dpw.ROAD_WIDTH % 2) == 0) {
@ -44,6 +46,7 @@ public abstract class SquarePlotManager extends GridPlotManager {
} else { } else {
pathWidthLower = dpw.ROAD_WIDTH / 2; pathWidthLower = dpw.ROAD_WIDTH / 2;
} }
end = pathWidthLower + dpw.PLOT_WIDTH;
} }
final int size = dpw.PLOT_WIDTH + dpw.ROAD_WIDTH; final int size = dpw.PLOT_WIDTH + dpw.ROAD_WIDTH;
int idx; int idx;
@ -64,7 +67,6 @@ public abstract class SquarePlotManager extends GridPlotManager {
idz = (z/size) + 1; idz = (z/size) + 1;
z = (z % size); z = (z % size);
} }
final int end = pathWidthLower + dpw.PLOT_WIDTH;
final boolean northSouth = (z <= pathWidthLower) || (z > end); final boolean northSouth = (z <= pathWidthLower) || (z > end);
final boolean eastWest = (x <= pathWidthLower) || (x > end); final boolean eastWest = (x <= pathWidthLower) || (x > end);
if (northSouth || eastWest) { if (northSouth || eastWest) {
@ -81,10 +83,18 @@ public abstract class SquarePlotManager extends GridPlotManager {
} }
final int size = dpw.PLOT_WIDTH + dpw.ROAD_WIDTH; final int size = dpw.PLOT_WIDTH + dpw.ROAD_WIDTH;
int pathWidthLower; int pathWidthLower;
if ((dpw.ROAD_WIDTH % 2) == 0) { final int end;
pathWidthLower = (dpw.ROAD_WIDTH / 2) - 1; if (dpw.ROAD_WIDTH == 0) {
} else { pathWidthLower = -1;
pathWidthLower = dpw.ROAD_WIDTH / 2; end = dpw.PLOT_WIDTH;
}
else {
if ((dpw.ROAD_WIDTH % 2) == 0) {
pathWidthLower = (dpw.ROAD_WIDTH / 2) - 1;
} else {
pathWidthLower = dpw.ROAD_WIDTH / 2;
}
end = pathWidthLower + dpw.PLOT_WIDTH;
} }
int dx; int dx;
int dz; int dz;
@ -106,7 +116,6 @@ public abstract class SquarePlotManager extends GridPlotManager {
dz = (z/size) + 1; dz = (z/size) + 1;
rz = (z % size); rz = (z % size);
} }
final int end = pathWidthLower + dpw.PLOT_WIDTH;
final boolean northSouth = (rz <= pathWidthLower) || (rz > end); final boolean northSouth = (rz <= pathWidthLower) || (rz > end);
final boolean eastWest = (rx <= pathWidthLower) || (rx > end); final boolean eastWest = (rx <= pathWidthLower) || (rx > end);
if (northSouth && eastWest) { if (northSouth && eastWest) {