Fixed ship flight targeting / Fixed unit weapon sprite offset
This commit is contained in:
@@ -155,12 +155,10 @@ public class Renderer extends RendererModule{
|
||||
}else{
|
||||
Vector2 position = averagePosition();
|
||||
|
||||
if(!mobile){
|
||||
if(players[0].isDead()){
|
||||
smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f);
|
||||
}else{
|
||||
setCamera(position.x + 0.0001f, position.y + 0.0001f);
|
||||
}
|
||||
if(players[0].isDead()){
|
||||
smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f);
|
||||
}else if(!mobile){
|
||||
setCamera(position.x + 0.0001f, position.y + 0.0001f);
|
||||
}
|
||||
|
||||
if(world.getSector() == null){
|
||||
|
||||
@@ -27,7 +27,6 @@ import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
|
||||
import io.anuke.mindustry.world.blocks.units.MechFactory;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.entities.EntityGroup;
|
||||
import io.anuke.ucore.entities.trait.SolidTrait;
|
||||
@@ -227,10 +226,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
public void set(float x, float y){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
if(isFlying() && isLocal){
|
||||
Core.camera.position.set(x, y, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -612,12 +607,17 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
if(moveTarget != null && !moveTarget.isDead()){
|
||||
targetX = moveTarget.getX();
|
||||
targetY = moveTarget.getY();
|
||||
boolean tapping = moveTarget instanceof TileEntity && moveTarget.getTeam() == team;
|
||||
attractDst = 0f;
|
||||
|
||||
if(tapping){
|
||||
velocity.setAngle(Mathf.slerpDelta(velocity.angle(), angleTo(moveTarget), 0.1f));
|
||||
}
|
||||
|
||||
if(distanceTo(moveTarget) < 2f){
|
||||
if(moveTarget instanceof CarriableTrait){
|
||||
carry((CarriableTrait) moveTarget);
|
||||
}else if(moveTarget instanceof TileEntity && ((TileEntity) moveTarget).tile.block() instanceof MechFactory){
|
||||
}else if(tapping){
|
||||
Tile tile = ((TileEntity) moveTarget).tile;
|
||||
tile.block().tapped(tile, this);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
||||
}
|
||||
|
||||
public boolean isDead(){
|
||||
return dead;
|
||||
return dead || tile.entity != this;
|
||||
}
|
||||
|
||||
public void write(DataOutputStream stream) throws IOException{
|
||||
|
||||
Reference in New Issue
Block a user