mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 11:29:48 +07:00
Fixed ship flight targeting / Fixed unit weapon sprite offset
This commit is contained in:
parent
0b4b30286d
commit
5e29115c2e
@ -26,7 +26,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = '3d515618feeb9d05fd2727320be7e612e0b8c859'
|
||||
uCoreVersion = 'b6c84cdaad80c58267bdb0fc91d7197bb2252247'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -609,7 +609,7 @@ block.thermal-pump.name=Thermal Pump
|
||||
block.dagger-pad.name=Dagger Pad
|
||||
block.titan-pad.name=Titan Pad
|
||||
block.thermal-generator.name=Thermal Generator
|
||||
block.alloy-smelter.name=Alloy Smtler
|
||||
block.alloy-smelter.name=Alloy Smelter
|
||||
block.mend-projector.name=Mend Projector
|
||||
block.surge-wall.name=Surge Wall
|
||||
block.surge-wall-large.name=Large Surge Wall
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
@ -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{
|
||||
|
@ -111,11 +111,11 @@ public class Generators {
|
||||
|
||||
image.draw(type.weapon.equipRegion,
|
||||
-(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2,
|
||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
|
||||
false, false);
|
||||
image.draw(type.weapon.equipRegion,
|
||||
(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2,
|
||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
|
||||
true, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user