diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index abb45af482..43e03449aa 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -57,17 +57,17 @@ private _eventParams = [_vehicle, _turretPath, objNull, _carryMag, _ammo, _gunne if (_instantReload) exitWith { TRACE_1("calling addTurretMag event: instant AI reload",_this); - [QGVAR(addTurretMag), _eventParams] call CBA_fnc_globalEvent; + [QGVAR(addTurretMag), _eventParams, _vehicle, _turretPath] call CBA_fnc_turretEvent; }; private _timeToLoad = GET_NUMBER(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime",1); TRACE_1("Reloading in progress",_timeToLoad); [{ - params ["_vehicle", "", "", "", "", "_gunner"]; + params ["_vehicle", "_turretPath", "", "", "", "_gunner"]; if !(alive _vehicle && {alive _gunner}) exitWith {TRACE_2("invalid state",alive _vehicle,alive _gunner);}; // Reload the static weapon TRACE_1("calling addTurretMag event: AI reload",_this); - [QGVAR(addTurretMag), _this] call CBA_fnc_globalEvent; + [QGVAR(addTurretMag), _this, _vehicle, _turretPath] call CBA_fnc_turretEvent; }, _eventParams, _timeToLoad] call CBA_fnc_waitAndExecute; diff --git a/addons/csw/functions/fnc_getUnloadActions.sqf b/addons/csw/functions/fnc_getUnloadActions.sqf index 2aa0f7df11..94cae8608d 100644 --- a/addons/csw/functions/fnc_getUnloadActions.sqf +++ b/addons/csw/functions/fnc_getUnloadActions.sqf @@ -30,7 +30,7 @@ private _statement = { { (_this select 0) params ["_target", "_turretPath", "", "_carryMag", "_vehMag"]; TRACE_5("unload progressBar finish",_target,_turretPath,_carryMag,_vehMag,_player); - [QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player]] call CBA_fnc_globalEvent; + [QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player], _target, _turretPath] call CBA_fnc_turretEvent; }, {TRACE_1("unload progressBar fail",_this);}, format [LLSTRING(actionUnload), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")], diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index d6ebce2a4a..0853be357f 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -50,8 +50,8 @@ private _onFinish = { }; TRACE_1("calling addTurretMag event",_args); - [QGVAR(addTurretMag), _args] call CBA_fnc_globalEvent; - }, [_magSource, _unit, [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend]]] call CBA_fnc_execNextFrame; + [QGVAR(addTurretMag), _args, _args select 0, _args select 1] call CBA_fnc_turretEvent; + }, [_magSource, _unit, [_vehicle, _turret, _magSource, _carryMag, _ammo]]] call CBA_fnc_execNextFrame; }; [