Synced whole place queue / Fixed player flash desync

This commit is contained in:
Anuken
2018-08-14 18:51:06 -04:00
parent f8ddc8325c
commit a041c1e60d
3 changed files with 15 additions and 20 deletions
@@ -82,14 +82,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
//region unit and event overrides, utility methods
@Remote(targets = Loc.server, called = Loc.server)
public static void onPlayerDamage(Player player, float amount){
if(player == null) return;
player.hitTime = hitDuration;
player.health -= amount;
}
@Remote(targets = Loc.server, called = Loc.server)
public static void onPlayerDeath(Player player){
if(player == null) return;
@@ -227,7 +219,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
@Override
public void damage(float amount){
Call.onPlayerDamage(this, calculateDamage(amount));
hitTime = hitDuration;
if(!Net.client()){
health -= amount;
}
if(health <= 0 && !dead){
Call.onPlayerDeath(this);