Conveyor Upgrade End Rotation (#5512)
This commit is contained in:
@@ -1242,12 +1242,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
diagonal = !diagonal;
|
diagonal = !diagonal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int endRotation = -1;
|
||||||
if(diagonal){
|
if(diagonal){
|
||||||
var start = world.build(startX, startY);
|
var start = world.build(startX, startY);
|
||||||
var end = world.build(endX, endY);
|
var end = world.build(endX, endY);
|
||||||
if(block != null && start instanceof ChainedBuilding && end instanceof ChainedBuilding
|
if(block != null && start instanceof ChainedBuilding && end instanceof ChainedBuilding
|
||||||
&& block.canReplace(end.block) && block.canReplace(start.block)){
|
&& block.canReplace(end.block) && block.canReplace(start.block)){
|
||||||
points = Placement.upgradeLine(startX, startY, endX, endY);
|
points = Placement.upgradeLine(startX, startY, endX, endY);
|
||||||
|
endRotation = end.rotation;
|
||||||
}else{
|
}else{
|
||||||
points = Placement.pathfindLine(block != null && block.conveyorPlacement, startX, startY, endX, endY);
|
points = Placement.pathfindLine(block != null && block.conveyorPlacement, startX, startY, endX, endY);
|
||||||
}
|
}
|
||||||
@@ -1281,6 +1283,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
int result = baseRotation;
|
int result = baseRotation;
|
||||||
if(next != null){
|
if(next != null){
|
||||||
result = Tile.relativeTo(point.x, point.y, next.x, next.y);
|
result = Tile.relativeTo(point.x, point.y, next.x, next.y);
|
||||||
|
}else if(endRotation != -1){
|
||||||
|
result = endRotation;
|
||||||
}else if(block.conveyorPlacement && i > 0){
|
}else if(block.conveyorPlacement && i > 0){
|
||||||
Point2 prev = points.get(i - 1);
|
Point2 prev = points.get(i - 1);
|
||||||
result = Tile.relativeTo(prev.x, prev.y, point.x, point.y);
|
result = Tile.relativeTo(prev.x, prev.y, point.x, point.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user