Fixed #1460
This commit is contained in:
@@ -33,8 +33,7 @@ public class Pathfinder implements Runnable{
|
|||||||
/** handles task scheduling on the update thread. */
|
/** handles task scheduling on the update thread. */
|
||||||
private TaskQueue queue = new TaskQueue();
|
private TaskQueue queue = new TaskQueue();
|
||||||
/** current pathfinding thread */
|
/** current pathfinding thread */
|
||||||
private @Nullable
|
private @Nullable Thread thread;
|
||||||
Thread thread;
|
|
||||||
|
|
||||||
public Pathfinder(){
|
public Pathfinder(){
|
||||||
Events.on(WorldLoadEvent.class, event -> {
|
Events.on(WorldLoadEvent.class, event -> {
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ public class Teams{
|
|||||||
/** Active teams. */
|
/** Active teams. */
|
||||||
private Array<TeamData> active = new Array<>();
|
private Array<TeamData> active = new Array<>();
|
||||||
|
|
||||||
|
public Teams(){
|
||||||
|
active.add(get(Team.crux));
|
||||||
|
}
|
||||||
|
|
||||||
public @Nullable CoreEntity closestEnemyCore(float x, float y, Team team){
|
public @Nullable CoreEntity closestEnemyCore(float x, float y, Team team){
|
||||||
for(TeamData data : active){
|
for(TeamData data : active){
|
||||||
if(areEnemies(team, data.team)){
|
if(areEnemies(team, data.team)){
|
||||||
@@ -85,7 +89,6 @@ public class Teams{
|
|||||||
|
|
||||||
/** Returns whether {@param other} is an enemy of {@param #team}. */
|
/** Returns whether {@param other} is an enemy of {@param #team}. */
|
||||||
public boolean areEnemies(Team team, Team other){
|
public boolean areEnemies(Team team, Team other){
|
||||||
//todo what about derelict?
|
|
||||||
return team != other;
|
return team != other;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user