From f812daa095d2dbec4a786d501496a4f66b87d783 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 28 Jun 2023 05:55:45 -0500 Subject: [PATCH] Javelin - Fix weapon being in top-attack when loading AP magazine (#9161) Co-authored-by: BrettMayson Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/javelin/functions/fnc_onOpticDraw.sqf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 8304220fd9..a22fce8da6 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -55,6 +55,19 @@ if ((_ammoCount == 0) || // No ammo loaded _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); _this set [0, diag_frameno]; _this set [4, _fireDisabledEH]; + + // Fix weapon being in top-attack when loading AP magazine (https://feedback.bistudio.com/T171012) + if ((_currentShooter == ACE_player) && {_currentMagazine == "Titan_AP"} && {currentWeaponMode ACE_player == "TopDown"}) then { + { + _x params ["_xIndex", "", "", "", "_xMode"]; + if (_xMode == "Single") exitWith { + ACE_player action ["SwitchWeapon", _currentShooter, ACE_player, _xIndex]; + __JavelinIGUITop ctrlSetTextColor __ColorGray; + __JavelinIGUIDir ctrlSetTextColor __ColorGreen; + TRACE_2("fix top-attack for AP",weaponState _currentShooter,_x); + }; + } forEach (ACE_player weaponsInfo [_currentWeapon, true]); + }; };