Fix armor piercing not working against buildings (#8150)
This commit is contained in:
@@ -1597,7 +1597,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
public boolean collision(Bullet other){
|
public boolean collision(Bullet other){
|
||||||
boolean wasDead = health <= 0;
|
boolean wasDead = health <= 0;
|
||||||
|
|
||||||
damage(other.team, other.damage() * other.type().buildingDamageMultiplier);
|
float damage = other.damage() * other.type().buildingDamageMultiplier;
|
||||||
|
if(!other.type.pierceArmor){
|
||||||
|
damage = Damage.applyArmor(damage, block.armor);
|
||||||
|
}
|
||||||
|
|
||||||
|
damage(other.team, damage);
|
||||||
Events.fire(bulletDamageEvent.set(self(), other));
|
Events.fire(bulletDamageEvent.set(self(), other));
|
||||||
|
|
||||||
if(health <= 0 && !wasDead){
|
if(health <= 0 && !wasDead){
|
||||||
@@ -1853,7 +1858,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
if(Mathf.zero(dm)){
|
if(Mathf.zero(dm)){
|
||||||
damage = health + 1;
|
damage = health + 1;
|
||||||
}else{
|
}else{
|
||||||
damage = Damage.applyArmor(damage, block.armor) / dm;
|
damage /= dm;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO handle this better on the client.
|
//TODO handle this better on the client.
|
||||||
|
|||||||
Reference in New Issue
Block a user