Fixed some problems with Generators
This commit is contained in:
@@ -127,9 +127,8 @@ public class UI extends SceneModule{
|
||||
if(Vars.debug && !Vars.showUI) return;
|
||||
|
||||
if(Graphics.drawing()) Graphics.end();
|
||||
|
||||
scene.act();
|
||||
scene.draw();
|
||||
|
||||
act();
|
||||
|
||||
if(control.showCursor()) {
|
||||
Draw.color();
|
||||
|
||||
@@ -71,6 +71,14 @@ public class Tile{
|
||||
if(x == cx + 1 && y == cy) return 2;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public byte sizedRelativeTo(int cx, int cy){
|
||||
if(x == cx && y == cy - 1 - block().size/2) return 1;
|
||||
if(x == cx && y == cy + 1 + block().size/2) return 3;
|
||||
if(x == cx - 1 - block().size/2 && y == cy) return 0;
|
||||
if(x == cx + 1 + block().size/2 && y == cy) return 2;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public <T extends TileEntity> T entity(){
|
||||
return (T)entity;
|
||||
|
||||
@@ -214,7 +214,7 @@ public class Generator extends PowerBlock{
|
||||
|
||||
float r = interfering ? 0f : 0f;
|
||||
|
||||
int relative = tile.relativeTo(target.x, target.y);
|
||||
int relative = tile.sizedRelativeTo(target.x, target.y);
|
||||
|
||||
if(relative == -1){
|
||||
Shapes.laser("laser", "laserend", tile.worldx() + t2.x, tile.worldy() + t2.y,
|
||||
|
||||
Reference in New Issue
Block a user