Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit 6503f1c

Browse files
committedNov 25, 2016
Fix unscheduled trackLoop variable scope
1 parent 1622122 commit 6503f1c

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed
 

‎addons/main/XEH_preInit.sqf

+5
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ GVAR(insertFrequencyGroundVehicle) = 1;
1818
GVAR(insertFrequencyAirVehicle) = 1;
1919
GVAR(insertFrequencyMarkers) = 10;
2020

21+
GVAR(timeSinceLastInfantryInsert) = 0;
22+
GVAR(timeSinceLastGroundVehicleInsert) = 0;
23+
GVAR(timeSinceLastAirVehicleInsert) = 0;
24+
GVAR(timeSinceLastMarkerInsert) = 0;
25+
2126
ADDON = true;

‎addons/main/functions/fnc_trackLoop.sqf

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ private _functionLogName = "AAR > trackLoop";
1919

2020
DBUG("Starting track loop", _functionLogName);
2121

22-
private _timeSinceLastInfantryInsert = time;
23-
private _timeSinceLastGroundVehicleInsert = time;
24-
private _timeSinceLastAirVehicleInsert = time;
25-
private _timeSinceLastMarkerInsert = time;
22+
GVAR(timeSinceLastInfantryInsert) = time;
23+
GVAR(timeSinceLastGroundVehicleInsert) = time;
24+
GVAR(timeSinceLastAirVehicleInsert) = time;
25+
GVAR(timeSinceLastMarkerInsert) = time;
2626

2727
// Just log markers once (for now)
2828
call FUNC(trackMarkers);
2929

3030
[{
31+
3132
if (GVAR(logEvents)) then {
3233

3334
// We only want to log movements if there are players in the map
@@ -45,20 +46,19 @@ call FUNC(trackMarkers);
4546
GVAR(noPlayers) = false;
4647

4748
// We save unit positions at different frequencies depending on their vehicle
48-
49-
if (time >= _timeSinceLastInfantryInsert + GVAR(insertFrequencyInfantry)) then {
49+
if (time >= GVAR(timeSinceLastInfantryInsert) + GVAR(insertFrequencyInfantry)) then {
5050
call FUNC(trackInfantry);
51-
_timeSinceLastInfantryInsert = time;
51+
GVAR(timeSinceLastInfantryInsert) = time;
5252
};
5353

54-
if (time >= _timeSinceLastGroundVehicleInsert + GVAR(insertFrequencyGroundVehicle)) then {
54+
if (time >= GVAR(timeSinceLastGroundVehicleInsert) + GVAR(insertFrequencyGroundVehicle)) then {
5555
["ground"] call FUNC(trackVehicles);
56-
_timeSinceLastGroundVehicleInsert = time;
56+
GVAR(timeSinceLastGroundVehicleInsert) = time;
5757
};
5858

59-
if (time >= _timeSinceLastAirVehicleInsert + GVAR(insertFrequencyAirVehicle)) then {
59+
if (time >= GVAR(timeSinceLastAirVehicleInsert) + GVAR(insertFrequencyAirVehicle)) then {
6060
["air"] call FUNC(trackVehicles);
61-
_timeSinceLastAirVehicleInsert = time;
61+
GVAR(timeSinceLastAirVehicleInsert) = time;
6262
};
6363

6464
} else {

‎addons/main/script_mod.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define MAJOR 1
77
#define MINOR 0
8-
#define PATCHLVL 5
8+
#define PATCHLVL 6
99
#define BUILD 0
1010

1111
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD

0 commit comments

Comments
 (0)