Better diagonal placement system for nodes

This commit is contained in:
Anuken
2022-04-06 23:21:47 -04:00
parent 14558975cb
commit 5699ecc01c
4 changed files with 15 additions and 5 deletions

View File

@@ -1475,7 +1475,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
int endRotation = -1;
var start = world.build(startX, startY);
var end = world.build(endX, endY);
if(diagonal){
if(diagonal && (block == null || block.allowDiagonal)){
if(block != null && start instanceof ChainedBuilding && end instanceof ChainedBuilding
&& block.canReplace(end.block) && block.canReplace(start.block)){
points = Placement.upgradeLine(startX, startY, endX, endY);
@@ -1493,7 +1493,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
if(block != null){
block.changePlacementPath(points, rotation);
block.changePlacementPath(points, rotation, diagonal);
}
float angle = Angles.angle(startX, startY, endX, endY);