From 564e81e734c6a8d01d8a1b4b0430c18710d5fedd Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 21 May 2023 03:59:08 -0400 Subject: [PATCH] Team#isEnemy is pointless --- core/assets-raw/sprites/units/dagger.png | Bin 531 -> 523 bytes core/src/mindustry/entities/Damage.java | 2 +- core/src/mindustry/game/Team.java | 2 ++ core/src/mindustry/input/MobileInput.java | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/assets-raw/sprites/units/dagger.png b/core/assets-raw/sprites/units/dagger.png index 2fa4b1464d70c76122a4425adfd7c8f86c8bfde9..784c3c49e1aaaafc781f125a730f82a14a9dd2c4 100644 GIT binary patch delta 484 zcmbQt(#Pp0i(^PewW>H*wXr)~P!NzPNWaj~_<>`p zI;VuiS>^^u1rI?RhGkrVfsI-d1b93T7My+i?#;P3_ku3}ymRl(xqtu9zR_z?;Am3d zIP}J7dHsn^K9cI5i+V1bl&bAHv%Ws&0 zoP5u2-)U(n-3HF6T+^u^UngX&Ie05`=fycss^od+zHRHeSiND60K)>d_*1hCbtXOH zE)kwnqy3dt^<61j$w!%-M=NLWuKmRp#=P<9?=u$*XFBliI5OS4XKTOyofJpz?uISjsqhc!PL}n;f%h31c2{VLd4({`G;Z{DS$|-Q;W>x>{}=UaFS9x& zvHNuCHFK#K-=8lR+!?lisocA&b3gBiE?DO{yF%;O$=*Z>3;WlT&Tr3E_F9n5=Wer% zcddh{uwqLWd%>0qTYN$U`5opk_I3VWc45MEOR03uJv-k=#(Vt@vx=!IdA94$u+JmV4B$iSC%Z!a@8*Z|l34SC!P4$8HgN`)!v0EY4rEgCAVpbP#4i(^Pe=@Fx3=JElCJ3AnI4R!f15h*2r1^Mj*1Gijdi zmv4r8`WaIg)H2rI47jzvd7&Y@_VTG!i%)#Dld?L^E4ui4f~6vZ1Mj{mmiIS!bj@Ed z`@xgw*tmdWd*3za&1?3xF->!}u4P``c;iuRQb~+j0JGl5r^?4p9T(5Do6Y%HsJLvN z(7io-9e%S{A9wtz_Gf0myLy)^^$Z8}=1Fm@u43#va6@g;`~zDI-#P66zi7+$a%(T? z>eHoWX0J2;f4NM4&M)w_F+Fy&w(gp#UEE;?u_Lh^LNB^Ff66oH zs0SQ%;g~abd*-HT7qNkP9Q{2+c?-2Vn$OSKlI z6h5~Ls%xu+%swjiyM53W&Qe-d;V8i3D9{r5Tzu7`l}E4s2s*>Sz`)??>gTe~DWM4f DRZ8L= diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 4c2106e70b..3b3571df09 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -600,7 +600,7 @@ public class Damage{ for(int dx = -trad; dx <= trad; dx++){ for(int dy = -trad; dy <= trad; dy++){ Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy); - if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad*trad){ + if(tile != null && tile.build != null && (team == null || team != tile.team()) && dx*dx + dy*dy <= trad*trad){ tile.build.damage(team, damage); } } diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index 9bd6ee89c2..d5673dfdd6 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -121,6 +121,8 @@ public class Team implements Comparable{ return isAI() && !rules().rtsAi; } + /** @deprecated There is absolutely no reason to use this. */ + @Deprecated public boolean isEnemy(Team other){ return this != other; } diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index aec370fb38..126032c5e1 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -96,7 +96,7 @@ public class MobileInput extends InputHandler implements GestureListener{ }else{ Building tile = world.buildWorld(x, y); - if((tile != null && player.team().isEnemy(tile.team) && (tile.team != Team.derelict || state.rules.coreCapture)) || (tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged())){ + if((tile != null && player.team() != tile.team && (tile.team != Team.derelict || state.rules.coreCapture)) || (tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged())){ player.unit().mineTile = null; target = tile; }