Skip to content

Commit

Permalink
Fix cancelation
Browse files Browse the repository at this point in the history
  • Loading branch information
tuntematonjr committed Mar 19, 2023
1 parent 01984cd commit 34485e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion addons/firesupport/functions/fnc_firemission_end.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if (_nameList isEqualTo _name) then {
_firemissions deleteAt 0;
};


_gunModule setVariable [QGVAR(firemissions), _firemissions, true];
_gunModule setVariable [QGVAR(is_firing), false, true];
_gunModule setVariable [QGVAR(status), "STR_tun_firesupport_status_free" call BIS_fnc_localize, true];
Expand Down
9 changes: 7 additions & 2 deletions addons/firesupport/functions/fnc_removeQueue.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ if (_textQueue isEqualTo _firemissionText) then {
if (_status isEqualTo ("STR_tun_firesupport_status_firing" call BIS_fnc_localize)) then {
hintSilent ("STR_tun_firesupport_cancelMissions" call BIS_fnc_localize);
[{
_this params ["_gunModule", "_firemission"];
_this params ["_gunModule", "_firemission", "_ammoModule"];
private _firemissions = _gunModule getVariable [QGVAR(firemissions), []];
private _value = _firemissions find _firemission;
if (_value isNotEqualTo -1) then {
_firemissions deleteAt _value;
_gunModule setVariable [QGVAR(firemissions), _firemissions, true];
if (count _firemissions isEqualTo 0) then {
_ammoModule setVariable ["reservedCount", 0, true];
_gunModule setVariable [QGVAR(is_firing), false, true];
_gunModule setVariable [QGVAR(status), "STR_tun_firesupport_status_free" call BIS_fnc_localize, true];
};
};
}, [_gunModule, _firemission], 20] call CBA_fnc_waitAndExecute;
}, [_gunModule, _firemission, _ammoModule], 20] call CBA_fnc_waitAndExecute;
};
} else {
_firemissions deleteAt _curSelected;
Expand Down

0 comments on commit 34485e0

Please sign in to comment.