Skip to content

Commit

Permalink
Made bomb aimer maximum altitude config file customizeable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yskinator committed Sep 29, 2015
1 parent c7ab7b2 commit f533c30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions BahaTurret/BDArmorySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class BDArmorySettings : MonoBehaviour
public static bool SMART_GUARDS = true;
public static float MAX_BULLET_RANGE = 8000;
public static float TRIGGER_HOLD_TIME = 0.3f;
public static float MAX_BOMB_AIMER_ALTITUDE = 5000;

public static bool ALLOW_LEGACY_TARGETING = true;

Expand Down Expand Up @@ -587,6 +588,8 @@ public static void LoadConfig()

if(cfg.HasValue("TRIGGER_HOLD_TIME")) TRIGGER_HOLD_TIME = float.Parse(cfg.GetValue("TRIGGER_HOLD_TIME"));

if(cfg.HasValue("MAX_BOMB_AIMER_ALTITUDE")) MAX_BOMB_AIMER_ALTITUDE = float.Parse(cfg.GetValue("MAX_BOMB_AIMER_ALTITUDE"));

if(cfg.HasValue("ALLOW_LEGACY_TARGETING")) ALLOW_LEGACY_TARGETING = bool.Parse(cfg.GetValue("ALLOW_LEGACY_TARGETING"));

if(cfg.HasValue("TARGET_CAM_RESOLUTION")) TARGET_CAM_RESOLUTION = float.Parse(cfg.GetValue("TARGET_CAM_RESOLUTION"));
Expand Down
2 changes: 1 addition & 1 deletion BahaTurret/MissileFire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ void BombAimer()

bool AltitudeTrigger()
{
float maxAlt = Mathf.Clamp(BDArmorySettings.PHYSICS_RANGE * 0.75f, 2250, 5000);
float maxAlt = Mathf.Clamp(BDArmorySettings.PHYSICS_RANGE * 0.75f, 2250, BDArmorySettings.MAX_BOMB_AIMER_ALTITUDE);
double asl = vessel.mainBody.GetAltitude(vessel.findWorldCenterOfMass());
double radarAlt = asl - vessel.terrainAltitude;

Expand Down

0 comments on commit f533c30

Please sign in to comment.