From a5c44e7998e16a969ada99b891580fae3968155a Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 28 Jun 2021 10:50:04 -0400 Subject: [PATCH] #5055 --- core/src/mindustry/content/Blocks.java | 2 +- core/src/mindustry/content/UnitTypes.java | 2 +- core/src/mindustry/entities/comp/HealthComp.java | 5 ++--- core/src/mindustry/entities/comp/UnitComp.java | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index ac944ebcf4..7ae5070bcd 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1610,7 +1610,7 @@ public class Blocks implements ContentList{ size = 2; range = 190f; - reloadTime = 34f; + reloadTime = 31f; restitution = 0.03f; ammoEjectBack = 3f; cooldown = 0.03f; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 28fc88d56c..4c630b7340 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -572,7 +572,7 @@ public class UnitTypes implements ContentList{ speed = 1f; splashDamageRadius = 60f; instantDisappear = true; - splashDamage = 88f; + splashDamage = 90f; killShooter = true; hittable = false; collidesAir = true; diff --git a/core/src/mindustry/entities/comp/HealthComp.java b/core/src/mindustry/entities/comp/HealthComp.java index 85d0a37105..c06e6909e3 100644 --- a/core/src/mindustry/entities/comp/HealthComp.java +++ b/core/src/mindustry/entities/comp/HealthComp.java @@ -1,6 +1,5 @@ package mindustry.entities.comp; -import arc.math.*; import arc.util.*; import mindustry.annotations.Annotations.*; import mindustry.gen.*; @@ -34,7 +33,7 @@ abstract class HealthComp implements Entityc, Posc{ void kill(){ if(dead) return; - health = 0; + health = Math.min(health, 0); dead = true; killed(); remove(); @@ -86,7 +85,7 @@ abstract class HealthComp implements Entityc, Posc{ } void clampHealth(){ - health = Mathf.clamp(health, 0, maxHealth); + health = Math.min(health, maxHealth); } /** Heals by a flat amount. */ diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index dd64442f02..cfd1554ecc 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -397,7 +397,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I //move down elevation -= type.fallSpeed * Time.delta; - if(isGrounded()){ + if(isGrounded() || health <= -maxHealth){ Call.unitDestroy(id); } } @@ -528,7 +528,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I @Override public void killed(){ wasPlayer = isLocal(); - health = 0; + health = Math.min(health, 0); dead = true; //don't waste time when the unit is already on the ground, just destroy it