ACE3/addons/atragmx/functions/fnc_add_new_gun.sqf
Glowbal b489750d5b Minor optimizations using private, params, and isEqualType (#4323)
* Optimizations with private, params, and isEqualType

* Fixed tab being used instead of space

* Fixed tabs inserted by notepad++

* More usage of new private syntax and params

- changed a few checks for an array being empty to `_arr isEqualTo []`
rather than `count _arr == 0`
- added more uses of `private` on the same line as the variable is
declared
- added more uses of params to assign variables passed as parameters
- removed unnecessary parentheses
- removed several unnecessary variable declarations with private array
syntax

* clean up and formatting
2016-09-04 16:44:22 +02:00

28 lines
627 B
Plaintext

/*
* Author: Ruthberg
* Adds a new (default) gun profile to the profileNamespace
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_add_new_gun
*
* Public: No
*/
#include "script_component.hpp"
private _gunName = ctrlText 11001;
if (_gunName != "") then {
private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"],
GVAR(gunList) = GVAR(gunList) + [_gunProfileEntry];
lbAdd [6000, _gunProfileEntry select 0];
profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)];
};