Disable leg damage on disarmed units (#9755)

* Disable leg damage on disarmed units

* import

* Disable crush damage from disarmed units
This commit is contained in:
BalaM314
2024-04-19 19:10:47 +05:30
committed by GitHub
parent 206adf46bf
commit 7b759d41df
2 changed files with 4 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ import static mindustry.Vars.*;
@Component
abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec{
@Import float x, y, hitSize, rotation, speedMultiplier;
@Import boolean hovering;
@Import boolean hovering, disarmed;
@Import UnitType type;
@Import Team team;
@@ -62,7 +62,7 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec
}
//TODO should this apply to the player team(s)? currently PvE due to balancing
if(type.crushDamage > 0 && (walked || deltaLen() >= 0.01f) && t != null && t.build != null && t.build.team != team
if(type.crushDamage > 0 && !disarmed && (walked || deltaLen() >= 0.01f) && t != null && t.build != null && t.build.team != team
//damage radius is 1 tile smaller to prevent it from just touching walls as it passes
&& Math.max(Math.abs(dx), Math.abs(dy)) <= r - 1){