Fixed #11171
This commit is contained in:
@@ -2177,6 +2177,7 @@ public class UnitTypes{
|
||||
|
||||
buildSpeed = 3f;
|
||||
rotateToBuilding = false;
|
||||
range = maxRange = 180f;
|
||||
|
||||
abilities.add(new EnergyFieldAbility(40f, 65f, 180f){{
|
||||
statusDuration = 60f * 6f;
|
||||
|
||||
@@ -904,13 +904,11 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
//assume slight range margin
|
||||
float margin = 4f;
|
||||
|
||||
boolean skipWeapons = weapons.contains(w -> !w.useAttackRange);
|
||||
|
||||
//set up default range
|
||||
if(range < 0){
|
||||
range = Float.MAX_VALUE;
|
||||
for(Weapon weapon : weapons){
|
||||
if(!weapon.useAttackRange && skipWeapons) continue;
|
||||
if(!weapon.useAttackRange) continue;
|
||||
|
||||
range = Math.min(range, weapon.range() - margin);
|
||||
maxRange = Math.max(maxRange, weapon.range() - margin);
|
||||
@@ -921,7 +919,7 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
maxRange = Math.max(0f, range);
|
||||
|
||||
for(Weapon weapon : weapons){
|
||||
if(!weapon.useAttackRange && skipWeapons) continue;
|
||||
if(!weapon.useAttackRange) continue;
|
||||
|
||||
maxRange = Math.max(maxRange, weapon.range() - margin);
|
||||
}
|
||||
@@ -932,8 +930,9 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
fogRadius = Math.max(58f * 3f, hitSize * 2f) / 8f;
|
||||
}
|
||||
|
||||
if(weapons.isEmpty()){
|
||||
range = maxRange = mineRange;
|
||||
if(!weapons.contains(w -> w.useAttackRange)){
|
||||
if(range < 0 || range == Float.MAX_VALUE) range = mineRange;
|
||||
if(maxRange < 0 || maxRange == Float.MAX_VALUE) maxRange = mineRange;
|
||||
}
|
||||
|
||||
if(mechStride < 0){
|
||||
|
||||
Reference in New Issue
Block a user