This commit is contained in:
Anuken
2020-04-25 00:04:14 -04:00
parent 09e08a474b
commit 2e2c8ceab4
8 changed files with 18 additions and 12 deletions

View File

@@ -178,11 +178,11 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
public byte absoluteRelativeTo(int cx, int cy){
int x = tile.x, y = tile.y;
if(Math.abs(x - cx) > Math.abs(y - cy)){
if(x <= cx - 1 && y == cy) return 0;
if(x >= cx + 1 && y == cy) return 2;
if(x <= cx - 1) return 0;
if(x >= cx + 1) return 2;
}else{
if(x == cx && y <= cy - 1) return 1;
if(x == cx && y >= cy + 1) return 3;
if(y <= cy - 1) return 1;
if(y >= cy + 1) return 3;
}
return -1;