Skip to content

Commit

Permalink
Disposable - Ignore secondary muzzles (acemod#6737)
Browse files Browse the repository at this point in the history
Don't wipe weapon when firing spotting rifle muzzle
Close acemod#6736
  • Loading branch information
PabstMirror authored Dec 16, 2018
1 parent 31fa8cb commit dd94666
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/disposable/functions/fnc_replaceATWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd94666

Please sign in to comment.