File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1301,30 +1301,28 @@ public List<Unit> getUnitsInWeaponRange(final WeaponType weapon, final UnitFilte
13011301 getRight () + max ,
13021302 getBottom () + max ,
13031303 u -> {
1304- if (!pred .test (u )) {
1305- return false ;
1306- }
13071304 // Unit check and unit status
13081305 if (u == this || u .isInvincible ()) {
13091306 return false ;
13101307 }
1311-
13121308 // Weapon distance check
13131309 final int dist = getDistance (u );
13141310 if ((weapon .minRange () != 0 && dist < weapon .minRange ()) || dist > max ) {
13151311 return false ;
13161312 }
1317-
13181313 // Weapon behavioural checks
13191314 final UnitType ut = u .getType ();
1320- return (!weapon .targetsOwn () || u .getPlayer ().equals (getPlayer ())) &&
1321- (weapon .targetsAir () || u .isFlying ()) &&
1322- (weapon .targetsGround () || !u .isFlying ()) &&
1323- (!weapon .targetsMechanical () || !ut .isMechanical ()) &&
1324- (!weapon .targetsOrganic () || !ut .isOrganic ()) &&
1325- (!weapon .targetsNonBuilding () || ut .isBuilding ()) &&
1326- (!weapon .targetsNonRobotic () || ut .isRobotic ()) &&
1327- (!weapon .targetsOrgOrMech () || (!ut .isOrganic () && !ut .isMechanical ()));
1315+ if ((weapon .targetsOwn () && !u .getPlayer ().equals (getPlayer ())) ||
1316+ (!weapon .targetsAir () && !u .isFlying ()) ||
1317+ (!weapon .targetsGround () && u .isFlying ()) ||
1318+ (weapon .targetsMechanical () && ut .isMechanical ()) ||
1319+ (weapon .targetsOrganic () && ut .isOrganic ()) ||
1320+ (weapon .targetsNonBuilding () && !ut .isBuilding ()) ||
1321+ (weapon .targetsNonRobotic () && !ut .isRobotic ()) ||
1322+ (weapon .targetsOrgOrMech () && (ut .isOrganic () || ut .isMechanical ()))) {
1323+ return false ;
1324+ }
1325+ return pred .test (u );
13281326 });
13291327 }
13301328
You can’t perform that action at this time.
0 commit comments