This commit is contained in:
Anuken
2018-12-10 10:38:09 -05:00
parent 34ddb92e4d
commit 271dcd46bc
3 changed files with 7 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
Effects.effect(ExplosionFx.explosion, unit); Effects.effect(ExplosionFx.explosion, unit);
Effects.shake(2f, 2f, unit); Effects.shake(2f, 2f, unit);
//must run afterwards so the unit's group is not null //must run afterwards so the unit's group is not null when sending the removal packet
threads.runDelay(unit::remove); threads.runDelay(unit::remove);
} }

View File

@@ -22,8 +22,7 @@ import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.IOException; import java.io.IOException;
import static io.anuke.mindustry.Vars.headless; import static io.anuke.mindustry.Vars.*;
import static io.anuke.mindustry.Vars.players;
public class AlphaDrone extends FlyingUnit { public class AlphaDrone extends FlyingUnit {
static final float followDistance = 80f; static final float followDistance = 80f;
@@ -62,7 +61,7 @@ public class AlphaDrone extends FlyingUnit {
} }
} }
if(!leader.isShooting && distanceTo(leader) < 8f){ if(!leader.isShooting && distanceTo(leader) < 7f){
Call.onAlphaDroneFade(AlphaDrone.this); Call.onAlphaDroneFade(AlphaDrone.this);
} }
} }
@@ -71,8 +70,9 @@ public class AlphaDrone extends FlyingUnit {
@Remote(called = Loc.server) @Remote(called = Loc.server)
public static void onAlphaDroneFade(BaseUnit drone){ public static void onAlphaDroneFade(BaseUnit drone){
if(drone == null) return; if(drone == null) return;
drone.remove();
Effects.effect(UnitFx.pickup, drone); Effects.effect(UnitFx.pickup, drone);
//must run afterwards so the unit's group is not null when sending the removal packet
threads.runDelay(drone::remove);
} }
@Override @Override

View File

@@ -215,10 +215,10 @@ public class DesktopInput extends InputHandler{
}else if(selected != null){ }else if(selected != null){
//only begin shooting if there's no cursor event //only begin shooting if there's no cursor event
if (!tileTapped(selected) && !tryTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem && if (!tileTapped(selected) && !tryTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem &&
!tryBeginMine(selected) && player.getMineTile() == null) { !tryBeginMine(selected) && player.getMineTile() == null && !ui.chatfrag.chatOpen()) {
player.isShooting = true; player.isShooting = true;
} }
}else{ //if it's out of bounds, shooting is just fine }else if(!ui.chatfrag.chatOpen()){ //if it's out of bounds, shooting is just fine
player.isShooting = true; player.isShooting = true;
} }
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding()) && }else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding()) &&