mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
Merge branch 'master' into cleanup-2
This commit is contained in:
commit
f84e780f3b
106 changed files with 328 additions and 249 deletions
|
|
@ -481,8 +481,8 @@ public class DesktopInput extends InputHandler{
|
|||
deleting = true;
|
||||
}else if(selected != null){
|
||||
//only begin shooting if there's no cursor event
|
||||
if(!tileTapped(selected.build) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && (player.builder().plans().size == 0 || !player.builder().updateBuilding()) && !droppingItem &&
|
||||
!tryBeginMine(selected) && player.miner().mineTile() == null && !Core.scene.hasKeyboard()){
|
||||
if(!tileTapped(selected.build) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && !player.builder().activelyBuilding() && !droppingItem &&
|
||||
!tryBeginMine(selected) && player.miner().mineTile() == null && !Core.scene.hasKeyboard()){
|
||||
player.shooting = shouldShoot;
|
||||
}
|
||||
}else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine
|
||||
|
|
@ -603,13 +603,6 @@ public class DesktopInput extends InputHandler{
|
|||
boolean ground = unit.isGrounded();
|
||||
|
||||
float strafePenalty = ground ? 1f : Mathf.lerp(1f, unit.type.strafePenalty, Angles.angleDist(unit.vel().angle(), unit.rotation()) / 180f);
|
||||
float baseSpeed = unit.type.speed;
|
||||
|
||||
//limit speed to minimum formation speed to preserve formation
|
||||
if(unit.isCommanding()){
|
||||
//add a tiny multiplier to let units catch up just in case
|
||||
baseSpeed = unit.minFormationSpeed * 0.95f;
|
||||
}
|
||||
|
||||
float speed = unit.realSpeed() * strafePenalty;
|
||||
float xa = Core.input.axis(Binding.move_x);
|
||||
|
|
@ -627,9 +620,7 @@ public class DesktopInput extends InputHandler{
|
|||
if(aimCursor){
|
||||
unit.lookAt(mouseAngle);
|
||||
}else{
|
||||
if(!movement.isZero()){
|
||||
unit.lookAt(unit.vel.isZero() ? movement.angle() : unit.vel.angle());
|
||||
}
|
||||
unit.lookAt(unit.prefRotation());
|
||||
}
|
||||
|
||||
if(omni){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue