Fixed building relative rotations
This commit is contained in:
@@ -1019,6 +1019,7 @@ public class Blocks implements ContentList{
|
|||||||
craftTime = 60f * 1f;
|
craftTime = 60f * 1f;
|
||||||
heatOutput = 2f;
|
heatOutput = 2f;
|
||||||
consumes.liquid(Liquids.slag, 20f / 60f);
|
consumes.liquid(Liquids.slag, 20f / 60f);
|
||||||
|
consumes.power(0.5f / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
heatReactor = new HeatProducer("heat-reactor"){{
|
heatReactor = new HeatProducer("heat-reactor"){{
|
||||||
|
|||||||
@@ -307,8 +307,15 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
return relativeTo(tile.x, tile.y);
|
return relativeTo(tile.x, tile.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte relativeTo(Building tile){
|
public byte relativeTo(Building build){
|
||||||
return relativeTo(tile.tile);
|
if(Math.abs(x - build.x) > Math.abs(y - build.y)){
|
||||||
|
if(x <= build.x - 1) return 0;
|
||||||
|
if(x >= build.x + 1) return 2;
|
||||||
|
}else{
|
||||||
|
if(y <= build.y - 1) return 1;
|
||||||
|
if(y >= build.y + 1) return 3;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte relativeToEdge(Tile other){
|
public byte relativeToEdge(Tile other){
|
||||||
|
|||||||
Reference in New Issue
Block a user