Skip to content

Commit

Permalink
Territory warning icons limited to friendly territories only
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentRev committed Jan 23, 2019
1 parent 1bb7150 commit ad01ff1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/default_config.sqf
Expand Up @@ -146,7 +146,7 @@ A3W_vehicleLoot = 2; // Level of loot added to vehicles (0 = none,
// Territory settings
A3W_territoryCaptureTime = 3*60; // Time in seconds needed to capture a territory
A3W_territoryPayroll = 1; // Periodically reward sides and indie groups based on how many territories they own (0 = no, 1 = yes)
A3W_territoryWarningIcons = 0; // Show exclamation marks on map for territories where enemies are present (0 = no, 1 = yes)
A3W_territoryWarningIcons = 0; // Show exclamation marks on map for friendly territories where enemies are present (0 = no, 1 = yes)
A3W_payrollInterval = 30*60; // Delay in seconds between each payroll
A3W_payrollAmount = 100; // Amount of money rewarded per territory on each payroll

Expand Down
2 changes: 1 addition & 1 deletion territory/client/setupCaptureTriggers.sqf
Expand Up @@ -49,7 +49,7 @@ _warningIcons = ["A3W_territoryWarningIcons"] call isConfigOn;
_warnTrig = createTrigger ["EmptyDetector", markerPos _marker, false];
_warnTrig setTriggerArea [_markerSize select 0, _markerSize select 1, markerDir _marker, markerShape _marker == "RECTANGLE"];
_warnTrig setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_warnTrig setTriggerStatements ["{isPlayer _x && {!([_x, player] call A3W_fnc_isFriendly) && (_x modelToWorld [0,0,0]) select 2 <= 250}} count thisList > 0", _onEnter, _onExit];
_warnTrig setTriggerStatements [format ["_ownerTeam = missionNamespace getVariable ['%1_team', sideUnknown]; _friendlyTerr = if (_ownerTeam isEqualType sideUnknown) then { _ownerTeam == playerSide } else { [_ownerTeam, player] call A3W_fnc_isFriendly }; _friendlyTerr && {thisList findIf {isPlayer _x && {([_x, player] call A3W_fnc_isFriendly) && (_x modelToWorld [0,0,0]) select 2 <= 250}} != -1}", _marker], _onEnter, _onExit];
};
};
} forEach allMissionObjects "EmptyDetector";
4 changes: 4 additions & 0 deletions territory/client/updateTerritoryMarkers.sqf
Expand Up @@ -41,6 +41,8 @@ if (_team isEqualType grpNull && {(side _team) in [BLUFOR,OPFOR]}) then
_marker setMarkerColorLocal ([_team, false] call A3W_fnc_getTeamMarkerColor);
_marker setMarkerBrushLocal MARKER_BRUSH_OTHER;
};

missionNamespace setVariable [_marker + "_team", _team, false];
}
else
{
Expand All @@ -56,5 +58,7 @@ if (_team isEqualType grpNull && {(side _team) in [BLUFOR,OPFOR]}) then
_marker setMarkerColorLocal ([_team, false] call A3W_fnc_getTeamMarkerColor);
_marker setMarkerBrushLocal MARKER_BRUSH_OTHER;
};

missionNamespace setVariable [_marker + "_team", _team, false];
};
} forEach _territories;

0 comments on commit ad01ff1

Please sign in to comment.