More minor bugfixes

This commit is contained in:
Anuken 2018-01-13 15:01:52 -05:00
parent 4fc2097c62
commit dfda83004e
3 changed files with 11 additions and 4 deletions

View file

@ -409,7 +409,7 @@ public class Control extends Module{
Timers.run(60, () -> {
ui.restart.show();
netServer.handleGameOver();
if(Net.active() && Net.server()) netServer.handleGameOver();
});
}

View file

@ -43,6 +43,7 @@ public class NetClient extends Module {
boolean gotData = false;
boolean kicked = false;
IntSet requests = new IntSet();
IntSet recieved = new IntSet();
float playerSyncTime = 2;
float dataTimeout = 60*10;
@ -51,6 +52,7 @@ public class NetClient extends Module {
Net.handle(Connect.class, packet -> {
Net.setClientLoaded(false);
requests.clear();
recieved.clear();
connecting = true;
gotData = false;
kicked = false;
@ -168,7 +170,10 @@ public class NetClient extends Module {
Net.handle(EnemySpawnPacket.class, spawn -> {
Gdx.app.postRunnable(() -> {
//duplicates.
if(Vars.control.enemyGroup.getByID(spawn.id) != null) return;
if(Vars.control.enemyGroup.getByID(spawn.id) != null ||
recieved.contains(spawn.id)) return;
recieved.add(spawn.id);
Enemy enemy = new Enemy(EnemyType.getByID(spawn.type));
enemy.set(spawn.x, spawn.y);
@ -257,7 +262,9 @@ public class NetClient extends Module {
Net.handle(Player.class, player -> {
Gdx.app.postRunnable(() -> {
//duplicates.
if(Vars.control.enemyGroup.getByID(player.id) != null) return;
if(Vars.control.enemyGroup.getByID(player.id) != null ||
recieved.contains(player.id)) return;
recieved.add(player.id);
player.getInterpolator().last.set(player.x, player.y);
player.getInterpolator().target.set(player.x, player.y);

View file

@ -39,7 +39,7 @@ public class Player extends DestructibleEntity implements Syncable{
hitbox.setSize(5);
hitboxTile.setSize(4f);
maxhealth = 150;
maxhealth = 200;
heal();
}