mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
HuntIR - Fix connecting when ammo is null (#6099)
Fix #6093 `[_nearestHuntIRs select 0] call FUNC(cam);` would pass nill Also delay opening GUI for a frame to prevent issue with interaction menu
This commit is contained in:
parent
4857294510
commit
1b6dc5ae2d
@ -7,7 +7,7 @@ class CfgVehicles {
|
||||
class GVAR(open) {
|
||||
displayName = CSTRING(activateMonitor);
|
||||
condition = QUOTE([ARR_2(ACE_player,'ACE_HuntIR_monitor')] call EFUNC(common,hasItem));
|
||||
statement = QUOTE(call FUNC(huntir));
|
||||
statement = QUOTE([FUNC(huntir)] call CBA_fnc_execNextFrame;);
|
||||
showDisabled = 0;
|
||||
priority = 2;
|
||||
icon = QPATHTOF(UI\w_huntir_monitor_ca.paa);
|
||||
|
@ -49,6 +49,14 @@ createDialog QGVAR(cam_dialog_off);
|
||||
private _elapsedTime = CBA_missionTime - GVAR(startTime);
|
||||
private _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
|
||||
|
||||
if ((GVAR(state) in ["connecting", "connected"]) && {_nearestHuntIRs isEqualTo []}) then {
|
||||
TRACE_1("reseting back to search because no valid ammo exists anymore",GVAR(state));
|
||||
GVAR(state) = "searching";
|
||||
GVAR(done) = false;
|
||||
GVAR(message) = [];
|
||||
GVAR(connectionDelay) = 5;
|
||||
};
|
||||
|
||||
if ((!dialog) || GVAR(done)) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user