2015-05-08 16:43:26 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
*
|
|
|
|
* Reads the weapon class config and updates the config cache
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-05-22 16:42:09 +00:00
|
|
|
* 0: weapon - classname <string>
|
2015-05-08 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* 0: [_barrelTwist, _twistDirection, _barrelLength] <ARRAY>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"];
|
|
|
|
_weapon = _this;
|
|
|
|
|
|
|
|
_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist");
|
|
|
|
_twistDirection = 1;
|
|
|
|
if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then {
|
|
|
|
_twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection");
|
|
|
|
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
|
|
|
|
_twistDirection = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength");
|
|
|
|
|
|
|
|
_result = [_barrelTwist, _twistDirection, _barrelLength];
|
|
|
|
|
|
|
|
uiNamespace setVariable [format[QGVAR(%1), _weapon], _result];
|
|
|
|
|
|
|
|
_result
|