From dd94666c639fa84cf6c654207892667bde69aac3 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 16 Dec 2018 13:23:14 -0600 Subject: [PATCH] Disposable - Ignore secondary muzzles (#6737) Don't wipe weapon when firing spotting rifle muzzle Close #6736 --- addons/disposable/functions/fnc_replaceATWeapon.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf index a5ad1196f2c..dcb5d93c1dc 100644 --- a/addons/disposable/functions/fnc_replaceATWeapon.sqf +++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf @@ -18,11 +18,14 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); -if (!local _unit || {_weapon != secondaryWeapon _unit}) exitWith {}; +if (!local _unit || {_weapon != secondaryWeapon _unit} || {_weapon != _muzzle}) exitWith {}; private _replacementTube = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_UsedTube"); if (_replacementTube == "") exitWith {}; //If no replacement defined just exit +// Save magazine of spotting muzzle (should be re-added to replacement weapon) +(((getUnitLoadout _unit) select 1) select 5) params [["_spottingMag", ""], ["_spottingRnds", 0]]; +if (_spottingMag != "") then { _unit addMagazine [_spottingMag, _spottingRnds]; }; //Save array of items attached to launcher private _items = secondaryWeaponItems _unit; //Replace the orginal weapon with the 'usedTube' weapon