mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 03:00:29 +03:00
Avoidance radius clamp
This commit is contained in:
@@ -92,7 +92,7 @@ public class AvoidanceProcess implements AsyncProcess{
|
|||||||
float rad = Float.intBitsToFloat(items[i + 1]);
|
float rad = Float.intBitsToFloat(items[i + 1]);
|
||||||
float rad2 = rad * rad;
|
float rad2 = rad * rad;
|
||||||
|
|
||||||
int r = Math.max(1, Mathf.ceil(rad));
|
int r = Mathf.clamp(1, Mathf.ceil(rad), 20);
|
||||||
|
|
||||||
for(int dx = -r; dx <= r; dx++){
|
for(int dx = -r; dx <= r; dx++){
|
||||||
for(int dy = -r; dy <= r; dy++){
|
for(int dy = -r; dy <= r; dy++){
|
||||||
|
|||||||
Reference in New Issue
Block a user