mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-24 21:41:25 -08:00
More unit movement fixes
This commit is contained in:
parent
0fb86699a3
commit
9d157976db
1 changed files with 3 additions and 2 deletions
|
|
@ -377,9 +377,10 @@ public class AIController implements UnitController{
|
|||
|
||||
vec.setLength(speed * length);
|
||||
|
||||
if(arrive){
|
||||
if(arrive && length > 0){
|
||||
Tmp.v3.set(-unit.vel.x / unit.type.accel * 2f, -unit.vel.y / unit.type.accel * 2f).add((target.getX() - unit.x), (target.getY() - unit.y));
|
||||
if(unit.type.omniMovement || unit.type.rotateMoveFirst){
|
||||
|
||||
if(unit.type.omniMovement){
|
||||
vec.add(Tmp.v3).limit(speed * length);
|
||||
}else{
|
||||
//directly move the unit to prevent a backwards movement vector from messing things up
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue