Fixed avoidance layering
This commit is contained in:
@@ -60,13 +60,10 @@ public class AvoidanceProcess implements AsyncProcess{
|
|||||||
//only do avoidance if it's relevant to the team
|
//only do avoidance if it's relevant to the team
|
||||||
if(team.team.isAI() && !team.team.rules().rtsAi){
|
if(team.team.isAI() && !team.team.rules().rtsAi){
|
||||||
for(var unit : team.units){
|
for(var unit : team.units){
|
||||||
if(!unit.isFlying()){
|
if(unit.collisionLayer() == PhysicsProcess.layerGround){
|
||||||
int layer = unit.collisionLayer();
|
//scaling is oversized 2x because units need to avoid things that are at their origin tile
|
||||||
if(layer < PhysicsProcess.layers){
|
float scaling = 2f;
|
||||||
//scaling is oversized 2x because units need to avoid things that are at their origin tile
|
requests.add(Point2.pack(unit.tileX(), unit.tileY()), Float.floatToRawIntBits(unit.hitSize * unitCollisionRadiusScale / tilesize * scaling), unit.id);
|
||||||
float scaling = 2f;
|
|
||||||
requests.add(Point2.pack(unit.tileX(), unit.tileY()), Float.floatToRawIntBits(unit.hitSize * unitCollisionRadiusScale / tilesize * scaling), unit.id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user