Skip to content

Commit

Permalink
added macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Madin authored and Madin committed May 10, 2024
1 parent eb56a95 commit fda3b98
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions addons/main/functions/fn_HCfind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ if (!isMultiplayer) exitWith {0};
if (!isServer) exitWith {clientOwner};
private _owner = 2;
private _allHCs = entities "HeadlessClient_F";

{
_owner = owner _x;
if !(_owner isEqualTo 2) exitWith {};
}forEach _allHCs;

if (_owner isEqualTo 0) then {
_owner = 2;
};
Expand Down
12 changes: 6 additions & 6 deletions addons/main/functions/fn_checkActivateConditions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ if (_logic isEqualTo objNull) exitWith {
diag_log text "[MAI_fnc_checkActivateConditions] logic is objNull, exit script"
};

private _forceActivate = _logic getVariable ["forceActivate", false];
private _activationTriggers = _logic getVariable ["activationTriggers",[]];
private _activateCondition = _logic getVariable ["activateCondition", {true}];
private _activation = _logic getVariable ["activation", 1000];
private _includeAir = _logic getVariable ["includeAir", false];
private _forceActivate = _logic getVariable [QGWAR(forceActivate), false];
private _activationTriggers = _logic getVariable [QGWAR(activationTriggers),[]];
private _activateCondition = _logic getVariable [QGWAR(activateCondition), {true}];
private _activation = _logic getVariable [QGWAR(activation), 1000];
private _includeAir = _logic getVariable [QGWAR(includeAir), false];

private _activated = false;
if (_forceActivate) then {
Expand Down Expand Up @@ -57,7 +57,7 @@ if (_forceActivate) then {
};

if (_activated) then {
private _deleteTrigger = _logic getVariable ["deleteTrigger", false];
private _deleteTrigger = _logic getVariable [QGWAR(deleteTrigger), false];
if (_deleteTrigger) then {
[
{
Expand Down
4 changes: 2 additions & 2 deletions addons/main/functions/fn_expectedNewUnitsCountReturn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
*/
params [["_unitsCountChange", 0]];
private _expectedNewUnitsCount = missionNameSpace getVariable ["MAI_expectedNewUnitsCount", 0];
MAI_expectedNewUnitsCount = _expectedNewUnitsCount + _unitsCountChange;
private _expectedNewUnitsCount = missionNameSpace getVariable [QGWAR(expectedNewUnitsCount), 0];
GWAR(expectedNewUnitsCount) = _expectedNewUnitsCount + _unitsCountChange;
2 changes: 1 addition & 1 deletion addons/main/functions/fn_getVehicleInfo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _vehicleHitPoints deleteAt 1;
// vehicle skin
private _vehCustom = ([_vehicle] call BIS_fnc_getVehicleCustomization) select 0;
// ammunition
private _vehAmmo = magazinesAllTurrets vehicle player;
private _vehAmmo = magazinesAllTurrets _vehicle;
{
_x resize 3;
} forEach _vehAmmo;
Expand Down
6 changes: 3 additions & 3 deletions addons/main/functions/fn_moveInVehicleRole.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ params [
if (!alive _unit || !alive _vehicle) exitWith {};
if !(isNull objectParent _unit) exitWith {}; // unit in vehicle;

private _timesTried = _unit getVariable ["timesTried", 0];
private _timesTried = _unit getVariable [QGWAR(timesTried), 0];
if (_timesTried >= 5) exitWith {};
_unit setVariable ["timesTried", _timesTried + 1];
_unit setVariable [QGWAR(timesTried), _timesTried + 1];
private _role = toLower (_assignedRole select 0);

if (_role isEqualTo "driver") exitWith {
Expand Down Expand Up @@ -52,7 +52,7 @@ if (_timesTried > 0) then {
};
[
{
_this call MAI_fnc_moveInVehicleRole;
_this call FUNC(moveInVehicleRole);
},
_this,
1
Expand Down

0 comments on commit fda3b98

Please sign in to comment.