Fixes Tanks rotating needlessly after attack commands (#8112)

Co-authored-by: Garen7 <Garen7@users.noreply.github.com>
This commit is contained in:
Garen7
2023-01-07 11:54:26 -06:00
committed by GitHub
parent 54a9955e30
commit ba72e9c50d

View File

@@ -315,8 +315,8 @@ public class AIController implements UnitController{
vec.setLength(unit.speed() * length);
}
//do not move when infinite vectors are used.
if(vec.isNaN() || vec.isInfinite()) return;
//do not move when infinite vectors are used or if its zero.
if(vec.isNaN() || vec.isInfinite() || vec.isZero()) return;
if(!unit.type.omniMovement && unit.type.rotateMoveFirst){
float angle = vec.angle();