Fixed pad shader/disconnect bugs

This commit is contained in:
Anuken
2019-02-21 14:08:42 -05:00
parent 5b7b50f555
commit 9c240850b8
11 changed files with 30 additions and 15 deletions

View File

@@ -52,7 +52,7 @@ import static io.anuke.mindustry.Vars.*;
public class NetServer implements ApplicationListener{
public final static int maxSnapshotSize = 430;
private final static float serverSyncTime = 40, kickDuration = 30 * 1000;
private final static float serverSyncTime = 4, kickDuration = 30 * 1000;
private final static Vector2 vector = new Vector2();
private final static Rectangle viewport = new Rectangle();
private final static Array<Entity> returnArray = new Array<>();

View File

@@ -264,6 +264,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
}
if(isFlying()){
drownTime = 0f;
move(velocity.x * Time.delta(), velocity.y * Time.delta());
}else{
boolean onLiquid = floor.isLiquid;

View File

@@ -57,7 +57,7 @@ public class MechPad extends Block{
@Remote(targets = Loc.both, called = Loc.server)
public static void onMechFactoryTap(Player player, Tile tile){
if(player == null || !checkValidTap(tile, player) || !(tile.block() instanceof MechPad)) return;
if(player == null || !(tile.block() instanceof MechPad) || !checkValidTap(tile, player)) return;
MechFactoryEntity entity = tile.entity();
MechPad pad = (MechPad)tile.block();
@@ -153,11 +153,10 @@ public class MechPad extends Block{
Shaders.build.region = region;
Shaders.build.progress = entity.progress;
Shaders.build.time = -entity.time / 4f;
Shaders.build.time = -entity.time / 5f;
Shaders.build.color.set(Pal.accent);
Draw.shader(Shaders.build, false);
Shaders.build.apply();
Draw.shader(Shaders.build);
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.shader();

View File

@@ -120,8 +120,7 @@ public class UnitFactory extends Block{
Shaders.build.color.a = entity.speedScl;
Shaders.build.time = -entity.time / 10f;
Draw.shader(Shaders.build, false);
Shaders.build.apply();
Draw.shader(Shaders.build);
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.shader();

View File

@@ -24,6 +24,7 @@ public class PowerModule extends BlockModule{
for(int i = 0; i < links.size; i++){
stream.writeInt(links.get(i));
}
stream.writeFloat(satisfaction);
}
@Override
@@ -32,5 +33,6 @@ public class PowerModule extends BlockModule{
for(int i = 0; i < amount; i++){
links.add(stream.readInt());
}
satisfaction = stream.readFloat();
}
}