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