mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-27 16:00:51 -07:00
Fix armor piercing not working against buildings (#8150)
This commit is contained in:
parent
b2bb6136de
commit
6eeb49bb37
1 changed files with 7 additions and 2 deletions
|
|
@ -1597,7 +1597,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||
public boolean collision(Bullet other){
|
||||
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));
|
||||
|
||||
if(health <= 0 && !wasDead){
|
||||
|
|
@ -1853,7 +1858,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||
if(Mathf.zero(dm)){
|
||||
damage = health + 1;
|
||||
}else{
|
||||
damage = Damage.applyArmor(damage, block.armor) / dm;
|
||||
damage /= dm;
|
||||
}
|
||||
|
||||
//TODO handle this better on the client.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue