Common - Fix gesture anim lockout for some launchers (#8282)

This commit is contained in:
PabstMirror 2021-06-28 00:01:32 -05:00 committed by GitHub
parent 2fc352f461
commit 59e3b07c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -420,13 +420,18 @@ GVAR(reloadMutex_lastMagazines) = [];
private _gesture = getText (_wpnMzlConfig >> "reloadAction"); private _gesture = getText (_wpnMzlConfig >> "reloadAction");
if (_gesture == "") exitWith {}; //Ignore weapons with no reload gesture (binoculars) if (_gesture == "") exitWith {}; //Ignore weapons with no reload gesture (binoculars)
private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"];
private _animConfig = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; private _duration = 0;
private _duration = getNumber (configfile >> _animConfig >> "States" >> _gesture >> "speed"); if (_isLauncher) then {
_duration = getNumber (configfile >> "CfgMovesMaleSdr" >> "States" >> _gesture >> "speed");
};
if (_duration == 0) then {
_duration = getNumber (configfile >> "CfgGesturesMale" >> "States" >> _gesture >> "speed");
};
if (_duration != 0) then { if (_duration != 0) then {
_duration = if (_duration < 0) then { abs _duration } else { 1 / _duration }; _duration = if (_duration < 0) then { abs _duration } else { 1 / _duration };
} else { } else {
_duration = 3; _duration = 6;
}; };
TRACE_2("Reloading, blocking gestures",_weapon,_duration); TRACE_2("Reloading, blocking gestures",_weapon,_duration);