ACE3/addons/atragmx/functions/fnc_change_gun.sqf

39 lines
916 B
Plaintext
Raw Normal View History

/*
* Author: Ruthberg
* Selects a new gun profile and updates the gun column and the result input/output fields
*
* Arguments:
* gunID <number>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_change_gun
*
* Public: No
*/
#include "script_component.hpp"
2015-04-08 09:05:28 +00:00
if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {};
GVAR(workingMemory) = +(GVAR(gunList) select _this);
GVAR(currentGun) = _this;
lbSetCurSel [6000, GVAR(currentGun)];
if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then
{
GVAR(currentScopeUnit) = GVAR(workingMemory) select 6;
};
[] call FUNC(update_gun);
2015-04-08 09:05:28 +00:00
GVAR(elevationOutput) set [GVAR(currentTarget), 0];
GVAR(windageOutput) set [GVAR(currentTarget), 0];
GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];
[] call FUNC(calculate_target_solution);