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

Commit

Permalink
Fix unscheduled trackLoop variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcroox committed Nov 25, 2016
1 parent 1622122 commit 6503f1c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ GVAR(insertFrequencyGroundVehicle) = 1;
GVAR(insertFrequencyAirVehicle) = 1;
GVAR(insertFrequencyMarkers) = 10;

GVAR(timeSinceLastInfantryInsert) = 0;
GVAR(timeSinceLastGroundVehicleInsert) = 0;
GVAR(timeSinceLastAirVehicleInsert) = 0;
GVAR(timeSinceLastMarkerInsert) = 0;

ADDON = true;
22 changes: 11 additions & 11 deletions addons/main/functions/fnc_trackLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ private _functionLogName = "AAR > trackLoop";

DBUG("Starting track loop", _functionLogName);

private _timeSinceLastInfantryInsert = time;
private _timeSinceLastGroundVehicleInsert = time;
private _timeSinceLastAirVehicleInsert = time;
private _timeSinceLastMarkerInsert = time;
GVAR(timeSinceLastInfantryInsert) = time;
GVAR(timeSinceLastGroundVehicleInsert) = time;
GVAR(timeSinceLastAirVehicleInsert) = time;
GVAR(timeSinceLastMarkerInsert) = time;

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

[{

if (GVAR(logEvents)) then {

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

// We save unit positions at different frequencies depending on their vehicle

if (time >= _timeSinceLastInfantryInsert + GVAR(insertFrequencyInfantry)) then {
if (time >= GVAR(timeSinceLastInfantryInsert) + GVAR(insertFrequencyInfantry)) then {
call FUNC(trackInfantry);
_timeSinceLastInfantryInsert = time;
GVAR(timeSinceLastInfantryInsert) = time;
};

if (time >= _timeSinceLastGroundVehicleInsert + GVAR(insertFrequencyGroundVehicle)) then {
if (time >= GVAR(timeSinceLastGroundVehicleInsert) + GVAR(insertFrequencyGroundVehicle)) then {
["ground"] call FUNC(trackVehicles);
_timeSinceLastGroundVehicleInsert = time;
GVAR(timeSinceLastGroundVehicleInsert) = time;
};

if (time >= _timeSinceLastAirVehicleInsert + GVAR(insertFrequencyAirVehicle)) then {
if (time >= GVAR(timeSinceLastAirVehicleInsert) + GVAR(insertFrequencyAirVehicle)) then {
["air"] call FUNC(trackVehicles);
_timeSinceLastAirVehicleInsert = time;
GVAR(timeSinceLastAirVehicleInsert) = time;
};

} else {
Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define MAJOR 1
#define MINOR 0
#define PATCHLVL 5
#define PATCHLVL 6
#define BUILD 0

#define VERSION MAJOR.MINOR.PATCHLVL.BUILD
Expand Down

0 comments on commit 6503f1c

Please sign in to comment.