Implemented Anuken/Mindustry-Suggestions/issues/2809

This commit is contained in:
Anuken
2021-08-07 12:08:30 -04:00
parent ce9bfdbcae
commit b1b89290b9
3 changed files with 9 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -108,7 +108,13 @@ public class Placement{
points.addAll(result); points.addAll(result);
} }
public static boolean isSidePlace(Seq<BuildPlan> plans){
return plans.size > 1 && Mathf.mod(Tile.relativeTo(plans.first().x, plans.first().y, plans.get(1).x, plans.get(1).y) - plans.first().rotation, 2) == 1;
}
public static void calculateBridges(Seq<BuildPlan> plans, ItemBridge bridge){ public static void calculateBridges(Seq<BuildPlan> plans, ItemBridge bridge){
if(isSidePlace(plans)) return;
//check for orthogonal placement + unlocked state //check for orthogonal placement + unlocked state
if(!(plans.first().x == plans.peek().x || plans.first().y == plans.peek().y) || !bridge.unlockedNow()){ if(!(plans.first().x == plans.peek().x || plans.first().y == plans.peek().y) || !bridge.unlockedNow()){
return; return;
@@ -170,6 +176,8 @@ public class Placement{
} }
public static void calculateDuctBridges(Seq<BuildPlan> plans, DuctBridge bridge){ public static void calculateDuctBridges(Seq<BuildPlan> plans, DuctBridge bridge){
if(isSidePlace(plans)) return;
//check for orthogonal placement + unlocked state //check for orthogonal placement + unlocked state
if(!(plans.first().x == plans.peek().x || plans.first().y == plans.peek().y) || !bridge.unlockedNow()){ if(!(plans.first().x == plans.peek().x || plans.first().y == plans.peek().y) || !bridge.unlockedNow()){
return; return;
@@ -180,7 +188,6 @@ public class Placement{
var result = plans1.clear(); var result = plans1.clear();
var team = player.team(); var team = player.team();
var rot = plans.first().rotation;
outer: outer:
for(int i = 0; i < plans.size;){ for(int i = 0; i < plans.size;){

View File

@@ -8,4 +8,4 @@ kapt.include.compile.classpath=false
kotlin.stdlib.default.dependency=false kotlin.stdlib.default.dependency=false
#needed for android compilation #needed for android compilation
android.useAndroidX=true android.useAndroidX=true
archash=e226c78ba913d348c97430e453f038e824c06bcb archash=28f7dea17ba559a28e79111adc93cf0496ced031