Javelin - Fix weapon being in top-attack when loading AP magazine (#9161)

Co-authored-by: BrettMayson <brett@mayson.io>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
PabstMirror 2023-06-28 05:55:45 -05:00 committed by GitHub
parent 055503928c
commit f812daa095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);
};
};