Fix more things that hit non-hittable units (#7408)
* hittable check for EMP * hittable check for Damage#status * why push if don't get hit
This commit is contained in:
@@ -440,7 +440,7 @@ public class Damage{
|
|||||||
/** Applies a status effect to all enemy units in a range. */
|
/** Applies a status effect to all enemy units in a range. */
|
||||||
public static void status(Team team, float x, float y, float radius, StatusEffect effect, float duration, boolean air, boolean ground){
|
public static void status(Team team, float x, float y, float radius, StatusEffect effect, float duration, boolean air, boolean ground){
|
||||||
Cons<Unit> cons = entity -> {
|
Cons<Unit> cons = entity -> {
|
||||||
if(entity.team == team || !entity.within(x, y, radius) || (entity.isFlying() && !air) || (entity.isGrounded() && !ground)){
|
if(entity.team == team || !entity.checkTarget(air, ground) || !entity.hittable() || !entity.within(x, y, radius)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class EmpBulletType extends BasicBulletType{
|
|||||||
|
|
||||||
if(hitUnits){
|
if(hitUnits){
|
||||||
Units.nearbyEnemies(b.team, x, y, radius, other -> {
|
Units.nearbyEnemies(b.team, x, y, radius, other -> {
|
||||||
if(other.team != b.team){
|
if(other.team != b.team && other.hittable()){
|
||||||
var absorber = Damage.findAbsorber(b.team, x, y, other.x, other.y);
|
var absorber = Damage.findAbsorber(b.team, x, y, other.x, other.y);
|
||||||
if(absorber != null){
|
if(absorber != null){
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f) * dragMultiplier * state.rules.dragMultiplier;
|
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f) * dragMultiplier * state.rules.dragMultiplier;
|
||||||
|
|
||||||
//apply knockback based on spawns
|
//apply knockback based on spawns
|
||||||
if(team != state.rules.waveTeam && state.hasSpawns() && (!net.client() || isLocal())){
|
if(team != state.rules.waveTeam && state.hasSpawns() && (!net.client() || isLocal()) && hittable()){
|
||||||
float relativeSize = state.rules.dropZoneRadius + hitSize/2f + 1f;
|
float relativeSize = state.rules.dropZoneRadius + hitSize/2f + 1f;
|
||||||
for(Tile spawn : spawner.getSpawns()){
|
for(Tile spawn : spawner.getSpawns()){
|
||||||
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
||||||
|
|||||||
Reference in New Issue
Block a user