Skip to content

Commit

Permalink
Merge pull request #5 from acemod/master
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
gienkov committed Apr 20, 2015
2 parents 8530684 + 06a4f3d commit 5d2d13e
Show file tree
Hide file tree
Showing 49 changed files with 348 additions and 173 deletions.
1 change: 0 additions & 1 deletion addons/advanced_ballistics/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

ADDON = false;

PREP(calculateAirDensity);
PREP(calculateAmmoTemperatureVelocityShift);
PREP(calculateAtmosphericCorrection);
PREP(calculateBarrelLengthVelocityShift);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Author: Ruthberg
*
* Displays a wind info (colored arrow) in the top left corner of the screen
* Calculates the air density
*
* Arguments:
* 0: temperature - degrees celcius <NUMBER>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _pressure = _this select 2; // in hPa
_relativeHumidity = _this select 3; // as ratio 0-1
_atmosphereModel = _this select 4; // "ICAO" or "ASM"

_airDensity = [_temperature, _pressure, _relativeHumidity] call FUNC(calculateAirDensity);
_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity);

if (_atmosphereModel == "ICAO") then {
(STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient
Expand Down
6 changes: 3 additions & 3 deletions addons/advanced_ballistics/functions/fnc_handleFired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ _stabilityFactor = 1.5;

if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
_barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast;
_barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure);
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
};

Expand Down Expand Up @@ -288,7 +288,7 @@ if (GVAR(AdvancedAirDragEnabled)) then {
};

if (GVAR(AtmosphericDensitySimulationEnabled)) then {
_pressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 10 * overcast;
_pressure = (_bulletPosition select 2) call EFUNC(weather,calculateBarometricPressure);
_temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2);
_humidity = EGVAR(weather,currentHumidity);
_airDensity = STD_AIR_DENSITY_ICAO;
Expand All @@ -315,7 +315,7 @@ if (GVAR(AdvancedAirDragEnabled)) then {
_bulletVelocity = _bulletVelocity vectorDiff _accel;
} else {
if (GVAR(AtmosphericDensitySimulationEnabled)) then {
_pressureDeviation = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 1013.25 - 10 * overcast;
_pressureDeviation = (_bulletPosition select 2) call EFUNC(weather,calculateBarometricPressure) - 1013.25;
_temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2);
_humidity = EGVAR(weather,currentHumidity);
_airFriction = _airFriction + ((_temperature - 15) * 0.0000015 + _humidity * 0.0000040 + _pressureDeviation * -0.0000009);
Expand Down
14 changes: 14 additions & 0 deletions addons/atragmx/RscTitles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,13 @@ class ATragMX_Display {
idc=120060;
y=0.265*safezoneH+safezoneY+0.520;
};
class TEXT_GUN_AMMO_DATA_ZERO_RANGE_METER_INDICATOR: TEXT_GUN_AMMO_DATA_BORE_HEIGHT {
idc=120061;
w=0.05;
x=0.550*safezoneW+safezoneX+0.315;
y=0.265*safezoneH+safezoneY+0.520;
text="";
};
class TEXT_GUN_AMMO_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE {
idc=12008;
action=QUOTE(1 call FUNC(toggle_gun_ammo_data));
Expand Down Expand Up @@ -1327,6 +1334,13 @@ class ATragMX_Display {
idc=140060;
y=0.265*safezoneH+safezoneY+0.520;
};
class TEXT_TARGET_DATA_TARGET_RANGE_METER_INDICATOR: TEXT_TARGET_DATA_LATITUDE {
idc=140061;
w=0.05;
x=0.550*safezoneW+safezoneX+0.315;
y=0.265*safezoneH+safezoneY+0.520;
text="";
};
class TEXT_TARGET_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE {
idc=14008;
action=QUOTE(1 call FUNC(toggle_target_data));
Expand Down
12 changes: 6 additions & 6 deletions addons/atragmx/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) ==
GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList";
} else {
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model
GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0659, -0.0008600, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ],
GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657, -0.0006400, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ],

["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0008600, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ],
["12.7x99mm" , 853, 100, 0.0623, -0.0008600, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ],
["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0003740, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ],
["12.7x99mm" , 853, 100, 0.0623, -0.0006000, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ],

["12.7x54mm" , 300, 100, 0.3394, -0.0014000, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ],
["12.7x54mm" , 300, 100, 0.3395, -0.0001400, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ],

[".408 Chey Tac" , 910, 100, 0.0569, -0.0004800, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ],
[".408 Chey Tac" , 910, 100, 0.0571, -0.0003950, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ],

["9.3×64mm" , 870, 100, 0.0619, -0.0007500, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ],
["9.3×64mm" , 870, 100, 0.0619, -0.0010600, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ],

[".338LM 250gr" , 880, 100, 0.0598, -0.0006060, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"],
[".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"],
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_calculate_range_card.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ GVAR(rangeCardData) = [];

private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000,
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude] call FUNC(calculate_solution);
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution);
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ _barometricPressure = 1013.25;
_relativeHumidity = 0;

private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false, 1.5, 0, 0] call FUNC(calculate_solution);
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false, 1.5, 0, 0, 0] call FUNC(calculate_solution);

_scopeBaseAngle + (_result select 0) / 60
35 changes: 24 additions & 11 deletions addons/atragmx/functions/fnc_calculate_solution.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
#include "script_component.hpp"

private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_drag", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude"];
private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_drag", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude", "_directionOfFire"];
_scopeBaseAngle = _this select 0;
_bulletMass = _this select 1;
_boreHeight = _this select 2;
Expand All @@ -66,6 +66,7 @@ _storeRangeCardData = _this select 17;
_stabilityFactor = _this select 18;
_twistDirection = _this select 19;
_latitude = _this select 20;
_directionOfFire = _this select 21;

private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"];
_bulletPos = [0, 0, 0];
Expand Down Expand Up @@ -114,6 +115,12 @@ _speedTotal = 0;
_stepsTotal = 0;
_speedAverage = 0;

private ["_eoetvoesMultiplier"];
_eoetvoesMultiplier = 0;
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then {
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire);
};

_TOF = 0;

_bulletPos set [0, 0];
Expand Down Expand Up @@ -169,16 +176,19 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
_kineticEnergy = _kineticEnergy * 0.737562149;

if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false])) then {
if ((_bulletPos select 1) > 0) then {
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) then {
_horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage;
_horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _horizontalCoriolis;
_windage2 = _windage2 + _horizontalCoriolis;
};
};
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then {
if ((_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then {
_verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier;
_verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1));
_elevation = _elevation + _verticalCoriolis;
};
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) then {
_spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83;
_spinDrift = - atan(_spinDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _spinDrift;
Expand Down Expand Up @@ -206,16 +216,19 @@ if (_targetRange != 0) then {
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
_kineticEnergy = _kineticEnergy * 0.737562149;

if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false])) then {
if ((_bulletPos select 1) > 0) then {
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) then {
_horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage;
_horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _horizontalCoriolis;
_windage2 = _windage2 + _horizontalCoriolis;
};
};
if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then {
if ((_bulletPos select 1) > 0) then {
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then {
_verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier;
_verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1));
_elevation = _elevation + _verticalCoriolis;
};
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) then {
_spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83;
_spinDrift = - atan(_spinDeflection / (_bulletPos select 1));
_windage1 = _windage1 + _spinDrift;
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_calculate_target_solution.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ _targetRange = GVAR(targetRange) select GVAR(currentTarget);

private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000,
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude] call FUNC(calculate_solution);
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution);

GVAR(elevationOutput) set [GVAR(currentTarget), _result select 0];
GVAR(windage1Output) set [GVAR(currentTarget), (_result select 1) select 0];
Expand Down
26 changes: 17 additions & 9 deletions addons/atragmx/functions/fnc_change_gun.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*
* Arguments:
* gunID <number>
* update solution <BOOL>
* restore workingMemory from gunList <BOOL>
* update display <BOOL>
*
* Return Value:
* Nothing
Expand All @@ -16,23 +17,30 @@
*/
#include "script_component.hpp"

private ["_gunID", "_updateSolution"];
_gunID = _this select 0;
_updateSolution = _this select 1;
private ["_gunID", "_restoreMemory", "_updateDisplay"];
_gunID = _this select 0;
_restoreMemory = _this select 1;
_updateDisplay = _this select 2;

if (_gunID < 0 || _gunID > (count GVAR(gunList)) - 1) exitWith {};

GVAR(workingMemory) = +(GVAR(gunList) select _gunID);
if (_restoreMemory) then {
GVAR(workingMemory) = +(GVAR(gunList) select _gunID);
};
GVAR(currentGun) = _gunID;

lbSetCurSel [6000, GVAR(currentGun)];
if (_updateDisplay) then {
lbSetCurSel [6000, GVAR(currentGun)];
};

GVAR(currentScopeUnit) = 0 max (GVAR(workingMemory) select 6) min 3;
GVAR(currentScopeClickUnit) = 0 max (GVAR(workingMemory) select 7) min 2;
GVAR(currentScopeClickNumber) = 1 max (GVAR(workingMemory) select 8) min 10;

[] call FUNC(update_gun);
[] call FUNC(update_gun_ammo_data);
if (_updateDisplay) then {
[] call FUNC(update_gun);
[] call FUNC(update_gun_ammo_data);
};

GVAR(elevationOutput) set [GVAR(currentTarget), 0];
GVAR(windage1Output) set [GVAR(currentTarget), 0];
Expand All @@ -41,6 +49,6 @@ GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];

if (_updateSolution) then {
if (_updateDisplay) then {
[] call FUNC(calculate_target_solution);
};
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_create_dialog.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist);
GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist);
GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);

[GVAR(currentGun), false] call FUNC(change_gun);
[GVAR(currentGun), false, true] call FUNC(change_gun);

{
lbAdd [6000, _x select 0];
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_cycle_gun_list.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

if (!(GVAR(showMainPage) || GVAR(showGunList))) exitWith {};

[(GVAR(currentGun) + (count GVAR(gunList)) + _this) % (count GVAR(gunList)), true] call FUNC(change_gun);
[(GVAR(currentGun) + (count GVAR(gunList)) + _this) % (count GVAR(gunList)), true, true] call FUNC(change_gun);
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_restore_user_data.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "script_component.hpp"

GVAR(currentUnit) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentUnit", 2]) min 2;
GVAR(currentGun) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentGun", 0]);
[(profileNamespace getVariable ["ACE_ATragMX_currentGun", 0]), true, false] call FUNC(change_gun);
GVAR(currentTarget) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentTarget", 0]) min 3;
GVAR(currentScopeUnit) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentScopeUnit", 0]) min 3;

Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_show_gun_ammo_data.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

GVAR(showGunAmmoData) = _this;

{ctrlShow [_x, _this]} forEach [12000, 120000, 12001, 120010, 12002, 120020, 12003, 120030, 12004, 120040, 12005, 120050, 12006, 120060, 12007, 12008, 12009, 12010, 12011];
{ctrlShow [_x, _this]} forEach [12000, 120000, 12001, 120010, 12002, 120020, 12003, 120030, 12004, 120040, 12005, 120050, 12006, 120060, 120061, 12007, 12008, 12009, 12010, 12011];

if (_this) then {
[] call FUNC(update_gun_ammo_data);
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_show_target_data.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

GVAR(showTargetData) = _this;

{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 14006, 140060, 14007, 14008, 14009, 14010, 14011];
{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 14006, 140060, 140061, 14007, 14008, 14009, 14010, 14011];

if (_this) then {
[] call FUNC(update_target_data);
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_toggle_gun_list.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (ctrlVisible 6000) then {
true call FUNC(show_main_page);

if (_this) then {
[lbCurSel 6000, true] call FUNC(change_gun);
[lbCurSel 6000, true, true] call FUNC(change_gun);
};
} else {
false call FUNC(show_main_page);
Expand Down
9 changes: 7 additions & 2 deletions addons/atragmx/functions/fnc_update_gun_ammo_data.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ if (GVAR(currentUnit) != 2) then {
} else {
ctrlSetText [120050, Str(Round(GVAR(workingMemory) select 1))];
};
if (GVAR(currentUnit) == 2) then {
if (GVAR(currentUnit) == 1) then {
ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))];
} else {
ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))];
};
if (GVAR(currentUnit) == 0) then {
ctrlSetText [120061, "*"];
} else {
ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))];
ctrlSetText [120061, ""];
};

if (GVAR(currentUnit) == 2) then {
Expand Down
5 changes: 5 additions & 0 deletions addons/atragmx/functions/fnc_update_target_data.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ if (GVAR(currentUnit) == 1) then {
} else {
ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))];
};
if (GVAR(currentUnit) == 0) then {
ctrlSetText [140061, "*"];
} else {
ctrlSetText [140061, ""];
};

if (GVAR(currentUnit) == 2) then {
ctrlSetText [14002, "Wind Speed (m/s)"];
Expand Down
2 changes: 1 addition & 1 deletion addons/atragmx/functions/fnc_update_zero_range.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ _barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);

private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0] call FUNC(calculate_solution);
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0, 0] call FUNC(calculate_solution);

GVAR(workingMemory) set [2, _zeroRange];
GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60];
Loading

0 comments on commit 5d2d13e

Please sign in to comment.