Massive amount of bug/crash fixes, wave saving
This commit is contained in:
@@ -14,9 +14,9 @@ import io.anuke.mindustry.io.MapMeta;
|
||||
import io.anuke.mindustry.io.Version;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.BlockPart;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.entities.Entities;
|
||||
import io.anuke.ucore.entities.EntityPhysics;
|
||||
import io.anuke.ucore.util.Bits;
|
||||
|
||||
import java.io.*;
|
||||
@@ -205,6 +205,10 @@ public class NetworkIO {
|
||||
for (int j = 0; j < cores; j++) {
|
||||
state.teams.get(team).cores.add(world.tile(stream.readInt()));
|
||||
}
|
||||
|
||||
if(team == players[0].getTeam() && cores > 0){
|
||||
Core.camera.position.set(state.teams.get(team).cores.first().drawx(), state.teams.get(team).cores.first().drawy(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
world.endMapLoad();
|
||||
|
||||
@@ -8,11 +8,14 @@ import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.io.Version;
|
||||
import io.anuke.mindustry.net.Packet.ImportantPacket;
|
||||
import io.anuke.mindustry.net.Packet.UnimportantPacket;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.io.IOUtils;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
/**Class for storing all packets.*/
|
||||
public class Packets {
|
||||
|
||||
@@ -104,6 +107,7 @@ public class Packets {
|
||||
public long timeSent;
|
||||
//player snapshot data
|
||||
public float x, y, pointerX, pointerY, rotation, baseRotation, xv, yv;
|
||||
public Tile mining;
|
||||
public boolean boosting;
|
||||
|
||||
@Override
|
||||
@@ -125,6 +129,8 @@ public class Packets {
|
||||
//saving 4 bytes, yay?
|
||||
buffer.putShort((short)(player.rotation*2));
|
||||
buffer.putShort((short)(player.baseRotation*2));
|
||||
|
||||
buffer.putInt(player.getMineTile() == null ? -1 : player.getMineTile().packedPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,6 +148,7 @@ public class Packets {
|
||||
yv = buffer.get() / Unit.velocityPercision;
|
||||
rotation = buffer.getShort()/2f;
|
||||
baseRotation = buffer.getShort()/2f;
|
||||
mining = world.tile(buffer.getInt());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user