Fixed random collision deaths

This commit is contained in:
Anuken
2018-03-30 19:18:33 -04:00
parent 84548187f5
commit ed276ac79e
3 changed files with 6 additions and 14 deletions

View File

@@ -42,7 +42,6 @@ public class Player extends SyncEntity{
public Mech mech = Mech.standard;
public float targetAngle = 0f;
public float stucktime = 0f;
public boolean dashing = false;
public int clientid = -1;
@@ -54,7 +53,7 @@ public class Player extends SyncEntity{
public Player(){
hitbox.setSize(5);
hitboxTile.setSize(5f);
hitboxTile.setSize(4f);
maxhealth = 200;
heal();
@@ -161,15 +160,8 @@ public class Player extends SyncEntity{
Tile tile = world.tileWorld(x, y);
//if player is in solid block
if(tile != null && ((tile.floor().liquid && tile.block() == Blocks.air) || tile.solid())){
stucktime += Timers.delta();
}else{
stucktime = 0f;
}
if(stucktime > 15f){
damage(health+1); //die instantly
stucktime = 0f;
if(tile != null && ((tile.floor().liquid && tile.block() == Blocks.air) || tile.solid())) {
damage(health + 1); //die instantly
}
if(ui.chatfrag.chatOpen()) return;