Skip to content

Commit 1d5e50b

Browse files
committed
Small fix
1 parent 087e75d commit 1d5e50b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gameserver/src/main/java/brainwine/gameserver/zone/gen/GeneratorContext.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public boolean placePrefabSurface(Prefab prefab, int x) {
7575
int width = prefab.getWidth();
7676
int height = prefab.getHeight();
7777
int highestPoint = surface[x];
78-
int lowestPoint = surface[x];
78+
int lowestPoint = highestPoint;
7979
int startX = -1;
8080
int endX = x;
8181

@@ -89,6 +89,7 @@ public boolean placePrefabSurface(Prefab prefab, int x) {
8989
if(prefab.getBlocks()[(height - 1) * width + x1].getFrontItem().isWhole()) {
9090
if(startX == -1) {
9191
startX = x + x1;
92+
highestPoint = lowestPoint = surface[startX];
9293
}
9394

9495
endX = x + x1;
@@ -105,7 +106,9 @@ public boolean placePrefabSurface(Prefab prefab, int x) {
105106

106107
if(currentSurface < highestPoint) {
107108
highestPoint = currentSurface;
108-
} else if(currentSurface > lowestPoint) {
109+
}
110+
111+
if(currentSurface > lowestPoint) {
109112
lowestPoint = currentSurface;
110113
}
111114
}

0 commit comments

Comments
 (0)