mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
overheating: replace last spawn by a PFH
This commit is contained in:
parent
c8811552c8
commit
886ffacb35
@ -23,23 +23,26 @@ _jammedWeapons pushBack _weapon;
|
|||||||
|
|
||||||
_unit setVariable [QGVAR(jammedWeapons), _jammedWeapons];
|
_unit setVariable [QGVAR(jammedWeapons), _jammedWeapons];
|
||||||
|
|
||||||
|
|
||||||
// this is to re-activate the 'DefaultAction', so you can jam a weapon while full auto shooting
|
// this is to re-activate the 'DefaultAction', so you can jam a weapon while full auto shooting
|
||||||
[_unit, _weapon] spawn {
|
_fnc_stopCurrentBurst = {
|
||||||
_unit = _this select 0;
|
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||||
_weapon = _this select 1;
|
EXPLODE_4_PVT(_params,_unit,_weapon,_ammo,_startFrame);
|
||||||
|
|
||||||
_ammo = _unit ammo _weapon;
|
// Skip the first execution of the PFH
|
||||||
|
if (diag_frameno == _startFrame) exitWith {};
|
||||||
|
|
||||||
_frame = diag_frameno;
|
// Remove the PFH on the second execution
|
||||||
|
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||||
if (_ammo > 0) then {
|
|
||||||
_unit setAmmo [_weapon, 0];
|
|
||||||
|
|
||||||
waitUntil {_frame < diag_frameno};
|
|
||||||
|
|
||||||
_unit setAmmo [_weapon, _ammo];
|
_unit setAmmo [_weapon, _ammo];
|
||||||
//[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
|
};
|
||||||
};
|
|
||||||
|
// Stop current burst
|
||||||
|
_ammo = _unit ammo _weapon;
|
||||||
|
if (_ammo > 0) then {
|
||||||
|
_unit setAmmo [_weapon, 0];
|
||||||
|
[_fnc_stopCurrentBurst, 0, [_unit, _weapon, _ammo, diag_frameno]] call cba_fnc_addPerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
// only display the hint once, after you try to shoot an already jammed weapon
|
// only display the hint once, after you try to shoot an already jammed weapon
|
||||||
|
Loading…
Reference in New Issue
Block a user