Minor logic unit rotation fix / Core capture unit derelict tareting
This commit is contained in:
@@ -285,7 +285,7 @@ public class BlockIndexer{
|
||||
for(int i = 0; i < activeTeams.size; i++){
|
||||
Team enemy = activeTeams.items[i];
|
||||
|
||||
if(enemy == team || team == Team.derelict) continue;
|
||||
if(enemy == team || (team == Team.derelict && !state.rules.coreCapture)) continue;
|
||||
|
||||
Building entity = indexer.findTile(enemy, x, y, range, pred, true);
|
||||
if(entity != null){
|
||||
@@ -360,7 +360,7 @@ public class BlockIndexer{
|
||||
private void process(Tile tile){
|
||||
var team = tile.team();
|
||||
//only process entity changes with centered tiles
|
||||
if(tile.isCenter() && team != Team.derelict){
|
||||
if(tile.isCenter() && tile.build != null){
|
||||
var data = team.data();
|
||||
if(tile.block().flags.size() > 0 && tile.isCenter()){
|
||||
TileArray[] map = getFlagged(team);
|
||||
|
||||
@@ -119,9 +119,11 @@ public class Pathfinder implements Runnable{
|
||||
}
|
||||
}
|
||||
|
||||
int tid = tile.getTeamID();
|
||||
|
||||
return PathTile.get(
|
||||
tile.build == null || !solid || tile.block() instanceof CoreBlock ? 0 : Math.min((int)(tile.build.health / 40), 80),
|
||||
tile.getTeamID(),
|
||||
tid == 0 && tile.build != null && state.rules.coreCapture ? 255 : tid, //use teamid = 255 when core capture is enabled to mark out derelict structures
|
||||
solid,
|
||||
tile.floor().isLiquid,
|
||||
tile.staticDarkness() >= 2 || (tile.floor().solid && tile.block() == Blocks.air),
|
||||
|
||||
@@ -104,7 +104,7 @@ public class LogicAI extends AIController{
|
||||
//look where moving if there's nothing to aim at
|
||||
if(!shoot){
|
||||
unit.lookAt(unit.prefRotation());
|
||||
}else if(unit.hasWeapons() && unit.mounts.length > 0){ //if there is, look at the object
|
||||
}else if(unit.hasWeapons() && unit.mounts.length > 0 && !unit.mounts[0].weapon.ignoreRotation){ //if there is, look at the object
|
||||
unit.lookAt(unit.mounts[0].aimX, unit.mounts[0].aimY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user