Fix adv. throw key handling when reloading (#5336)

* Fix throw key handling when reloading

* Consider UGL reload to ace_common_isReloading var

* Fix if space, change private var assign

* Shorten UGL check
This commit is contained in:
Dystopian 2017-07-10 22:44:02 +03:00 committed by jonpas
parent 84061cb593
commit dd3a66a643
3 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), {
// Condition
if (!([ACE_player] call FUNC(canPrepare))) exitWith {false};
if (EGVAR(common,isReloading)) exitWith {true};
// Statement
[ACE_player] call FUNC(prepare);

View File

@ -32,6 +32,5 @@ GVAR(enabled) &&
#endif
{!(call EFUNC(common,isFeatureCameraActive))} &&
{!EGVAR(common,isReloading)} &&
{[_unit, objNull, ["isNotInside", "isNotSitting"/*, "isNotOnLadder"*/]] call EFUNC(common,canInteractWith)} && // Ladder needs positioning fixes on throw
{_unit call CBA_fnc_canUseWeapon} // Disable in non-FFV seats due to surface detection issues

View File

@ -373,7 +373,9 @@ GVAR(isReloading) = false;
private _weapon = currentWeapon ACE_player;
if (_weapon != "") then {
private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction");
private _muzzle = currentMuzzle ACE_player;
private _wpnConfig = configFile >> "CfgWeapons" >> _weapon;
private _gesture = getText ([_wpnConfig >> _muzzle, _wpnConfig] select (_weapon isEqualTo _muzzle) >> "reloadAction");
if (_gesture == "") exitWith {}; //Ignore weapons with no reload gesture (binoculars)
private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"];
private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher;