Skip to content

Commit

Permalink
Lock airbase vehicles, unlock on flag capture
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceIsFatto committed Aug 23, 2024
1 parent 443c7e8 commit af6adb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion A3A/addons/core/functions/Base/fn_mrkWIN.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ if (_caller isNotEqualTo player) exitWith {

private _markerX = [airportsX + resourcesX + factories + outposts + seaports + milbases, getPosATL _flagX] call BIS_fnc_nearestPosition;

// private _hideEnemyMarkers = missionNamespace getVariable ["A3U_setting_hideEnemyMarkers",false];
private _vehicles = _flagX getVariable ["A3U_zoneVehicles", []];

{
[_x, false] call A3U_fnc_setLock;
} forEach _vehicles;

if (hideEnemyMarkers) then {
"Dum"+_markerX setMarkerAlpha 1;
Expand Down
8 changes: 5 additions & 3 deletions A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,11 @@ for "_i" from 0 to (count _array - 1) do {

["locationSpawned", [_markerX, "Airport", true]] call EFUNC(Events,triggerEvent);

// {

// } forEach _vehiclesX;
{
[_x, true] call A3U_fnc_setLock;
} forEach _vehiclesX;

flagX setVariable ["A3U_zoneVehicles", _vehiclesX];

waitUntil {sleep 1; (spawner getVariable _markerX == 2)};

Expand Down
1 change: 1 addition & 0 deletions A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ params [
];

if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false};
if (!(alive) _vehicle) exitWith {false};

_vehicle lock _state;

Expand Down

0 comments on commit af6adb7

Please sign in to comment.