mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Limit formation speed across collision layers
This commit is contained in:
parent
235c0222bf
commit
65aecbed20
3 changed files with 16 additions and 2 deletions
|
|
@ -309,10 +309,18 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
}
|
||||
}
|
||||
|
||||
float minSpeed = 100000000f;
|
||||
for(int i = 0; i < groups.length; i ++){
|
||||
var group = groups[i];
|
||||
if(group != null && group.units.size > 0){
|
||||
group.calculateFormation(targetAsVec, i);
|
||||
minSpeed = Math.min(group.minSpeed, minSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
for(var group : groups){
|
||||
if(group != null){
|
||||
group.minSpeed = minSpeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue