mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use turret events, fixed invalid param
This commit is contained in:
parent
71dcfb512c
commit
9a52511222
@ -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;
|
||||
|
@ -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")],
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user