Fixed #10410
This commit is contained in:
@@ -59,6 +59,8 @@ abstract class HealthComp implements Entityc, Posc{
|
||||
}
|
||||
|
||||
void damage(float amount){
|
||||
if(Float.isNaN(health)) health = 0f;
|
||||
|
||||
health -= amount;
|
||||
hitTime = 1f;
|
||||
if(health <= 0 && !dead){
|
||||
@@ -86,6 +88,7 @@ abstract class HealthComp implements Entityc, Posc{
|
||||
|
||||
void clampHealth(){
|
||||
health = Math.min(health, maxHealth);
|
||||
if(Float.isNaN(health)) health = 0f;
|
||||
}
|
||||
|
||||
/** Heals by a flat amount. */
|
||||
|
||||
@@ -45,6 +45,8 @@ abstract class ShieldComp implements Healthc, Posc{
|
||||
protected void rawDamage(float amount){
|
||||
boolean hadShields = shield > 0.0001f;
|
||||
|
||||
if(Float.isNaN(health)) health = 0f;
|
||||
|
||||
if(hadShields){
|
||||
shieldAlpha = 1f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user