Fixed shields not blocking blast compound explosions

This commit is contained in:
Anuken
2024-09-15 19:21:24 -04:00
parent 9911e602a0
commit 8ede0fa6f4
7 changed files with 27 additions and 22 deletions

View File

@@ -717,7 +717,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
if(type.flying && !spawnedByCore && type.createWreck && state.rules.unitCrashDamage(team) > 0){
var shields = indexer.getEnemy(team, BlockFlag.shield);
float crashDamage = Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f * state.rules.unitCrashDamage(team);
if(shields.isEmpty() || !shields.contains(b -> b instanceof UnitWreckShield s && s.absorbWreck(self(), crashDamage))){
if(shields.isEmpty() || !shields.contains(b -> b instanceof ExplosionShield s && s.absorbExplosion(x, y, crashDamage))){
Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, crashDamage, true, false, true);
}
}