PointDefenseWeapon no longer affects range
This commit is contained in:
@@ -715,6 +715,8 @@ public class UnitType extends UnlockableContent{
|
||||
if(range < 0){
|
||||
range = Float.MAX_VALUE;
|
||||
for(Weapon weapon : weapons){
|
||||
if(!weapon.useAttackRange) continue;
|
||||
|
||||
range = Math.min(range, weapon.range() - margin);
|
||||
maxRange = Math.max(maxRange, weapon.range() - margin);
|
||||
}
|
||||
@@ -724,6 +726,8 @@ public class UnitType extends UnlockableContent{
|
||||
maxRange = Math.max(0f, range);
|
||||
|
||||
for(Weapon weapon : weapons){
|
||||
if(!weapon.useAttackRange) continue;
|
||||
|
||||
maxRange = Math.max(maxRange, weapon.range() - margin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ public class Weapon implements Cloneable{
|
||||
public boolean autoTarget = false;
|
||||
/** whether to perform target trajectory prediction */
|
||||
public boolean predictTarget = true;
|
||||
/** if true, this weapon is used for attack range calculations */
|
||||
public boolean useAttackRange = true;
|
||||
/** ticks to wait in-between targets */
|
||||
public float targetInterval = 40f, targetSwitchInterval = 70f;
|
||||
/** rotation speed of weapon when rotation is enabled, in degrees/t*/
|
||||
|
||||
@@ -32,6 +32,7 @@ public class PointDefenseWeapon extends Weapon{
|
||||
controllable = false;
|
||||
rotate = true;
|
||||
useAmmo = false;
|
||||
useAttackRange = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user