PointDefenseWeapon no longer affects range
This commit is contained in:
@@ -715,6 +715,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
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) 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);
|
||||||
}
|
}
|
||||||
@@ -724,6 +726,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
maxRange = Math.max(0f, range);
|
maxRange = Math.max(0f, range);
|
||||||
|
|
||||||
for(Weapon weapon : weapons){
|
for(Weapon weapon : weapons){
|
||||||
|
if(!weapon.useAttackRange) continue;
|
||||||
|
|
||||||
maxRange = Math.max(maxRange, weapon.range() - margin);
|
maxRange = Math.max(maxRange, weapon.range() - margin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ public class Weapon implements Cloneable{
|
|||||||
public boolean autoTarget = false;
|
public boolean autoTarget = false;
|
||||||
/** whether to perform target trajectory prediction */
|
/** whether to perform target trajectory prediction */
|
||||||
public boolean predictTarget = true;
|
public boolean predictTarget = true;
|
||||||
|
/** if true, this weapon is used for attack range calculations */
|
||||||
|
public boolean useAttackRange = true;
|
||||||
/** ticks to wait in-between targets */
|
/** ticks to wait in-between targets */
|
||||||
public float targetInterval = 40f, targetSwitchInterval = 70f;
|
public float targetInterval = 40f, targetSwitchInterval = 70f;
|
||||||
/** rotation speed of weapon when rotation is enabled, in degrees/t*/
|
/** rotation speed of weapon when rotation is enabled, in degrees/t*/
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class PointDefenseWeapon extends Weapon{
|
|||||||
controllable = false;
|
controllable = false;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
useAmmo = false;
|
useAmmo = false;
|
||||||
|
useAttackRange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -25,4 +25,4 @@ org.gradle.caching=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=513474758f
|
archash=712ac8bf54
|
||||||
|
|||||||
Reference in New Issue
Block a user