diff --git a/addons/m119/XEH_postInit.sqf b/addons/m119/XEH_postInit.sqf index f0436ed..7210df0 100644 --- a/addons/m119/XEH_postInit.sqf +++ b/addons/m119/XEH_postInit.sqf @@ -53,3 +53,4 @@ GVAR(towingList) = [ _arty animateSource ["rest_rotation_source", _offRot]; _arty setPosWorld getPosWorld _arty; }] call CBA_fnc_addEventHandler; + diff --git a/addons/m119/XEH_preInit.sqf b/addons/m119/XEH_preInit.sqf index 20ef72a..265801b 100644 --- a/addons/m119/XEH_preInit.sqf +++ b/addons/m119/XEH_preInit.sqf @@ -7,8 +7,7 @@ ADDON = true; -[ - QGVAR(loadShell), +[QGVAR(loadShell), { params ["_arty", "_shell", "_turret"]; @@ -22,6 +21,17 @@ ADDON = true; } ] call CBA_fnc_addEventHandler; +[QGVAR(unloadShell), + { + params ["_arty", "_turret"]; + + private _mags = _arty magazinesTurret [_turret]; + { + _arty removeMagazinesTurret [_x, [_turret]]; + } forEach _mags; + } +] call CBA_fnc_addEventHandler; + [LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], { if (vehicle player == player) exitWith {}; diff --git a/addons/m119/functions/fnc_unload.sqf b/addons/m119/functions/fnc_unload.sqf index 2d4a1cb..1902a8c 100644 --- a/addons/m119/functions/fnc_unload.sqf +++ b/addons/m119/functions/fnc_unload.sqf @@ -29,9 +29,7 @@ params ["_arty", "_turret"]; if !([_arty] call FUNC(canUnload)) exitWith {}; private _mags = _arty magazinesTurret [_turret]; -{ - _arty removeMagazinesTurret [_x, [_turret]]; -} forEach _mags; +[QGVAR(unloadShell), [_arty, _turret], _arty, [-1]] call CBA_fnc_turretEvent; private _veh = "";