Skip to content

Commit 7a72ee7

Browse files
committed
Removed UAV Recon support from being readded upon completion
Replaced with timeout logic using global variable
1 parent a815943 commit 7a72ee7

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

source/support/mapclickuav.sqf

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
_timer = 60;
22
clicked = false;
33

4+
// Guard against calling UAV Recon too often
5+
if(support_uav_rec_timeout > 0) exitWith {
6+
["info",["Support is on Cooldown","UAV Recon is on "]] call bis_fnc_showNotification;
7+
};
8+
49
// IF NOT ENOUGH PTS
510
if (commandpointsblu1<3) exitWith {
611
["info",["Not enough command points","Not enough Command Points (3CP required)"]] call bis_fnc_showNotification;
@@ -15,7 +20,14 @@ while {_timer>0 AND !clicked} do {
1520
_timer = _timer-1; // remove 1 to timer
1621
sleep 1;
1722
};
18-
// TIMER ELLAPSED OR CLICKED
19-
sleep 80;
20-
_art = [player1,"uav_recon"] call BIS_fnc_addCommMenuItem;
21-
OnMapSingleClick "";
23+
24+
// TIMER ELAPSED OR CLICKED
25+
OnMapSingleClick "";
26+
27+
// Tick down timeout guard
28+
support_uav_rec_timeout = 80;
29+
while {support_uav_rec_timeout > 0} do {
30+
sleep 1;
31+
support_uav_rec_timeout = support_uav_rec_timeout - 1;
32+
publicVariable support_uav_rec_timeout;
33+
};

0 commit comments

Comments
 (0)