a bit less broken but still broken

This commit is contained in:
Anuken
2019-05-05 19:05:46 -04:00
parent 35b158dba7
commit bf073a84c8
57 changed files with 274 additions and 445 deletions
@@ -171,12 +171,10 @@ public class BlockIndexer{
for(int tx = rx * structQuadrantSize; tx < (rx + 1) * structQuadrantSize && tx < world.width(); tx++){
for(int ty = ry * structQuadrantSize; ty < (ry + 1) * structQuadrantSize && ty < world.height(); ty++){
Tile other = world.tile(tx, ty);
Tile other = world.ltile(tx, ty);
if(other == null) continue;
other = other.target();
if(other.entity == null || other.getTeam() != team || !pred.test(other) || !other.block().targetable)
continue;
@@ -293,7 +291,7 @@ public class BlockIndexer{
outer:
for(int x = quadrantX * structQuadrantSize; x < world.width() && x < (quadrantX + 1) * structQuadrantSize; x++){
for(int y = quadrantY * structQuadrantSize; y < world.height() && y < (quadrantY + 1) * structQuadrantSize; y++){
Tile result = world.tile(x, y).target();
Tile result = world.ltile(x, y);
//when a targetable block is found, mark this quadrant as occupied and stop searching
if(result.entity != null && result.getTeam() == data.team){
structQuadrants[data.team.ordinal()].set(index);
@@ -83,7 +83,7 @@ public class Pathfinder{
}
private boolean passable(Tile tile, Team team){
return (!tile.solid()) || (tile.breakable() && (tile.target().getTeam() != team));
return (!tile.solid()) || (tile.breakable() && (tile.getTeam() != team));
}
/**