From a3a91d4f45b22fd487ecbc954ad979be5d03efdd Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:38:09 +0300 Subject: init --- Common/Functions/Common_RearmVehicle.sqf | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Common/Functions/Common_RearmVehicle.sqf (limited to 'Common/Functions/Common_RearmVehicle.sqf') diff --git a/Common/Functions/Common_RearmVehicle.sqf b/Common/Functions/Common_RearmVehicle.sqf new file mode 100644 index 0000000..58ed35c --- /dev/null +++ b/Common/Functions/Common_RearmVehicle.sqf @@ -0,0 +1,39 @@ +Private["_amount","_get","_isAir","_isArtillery","_magazines","_side","_type","_vehicle"]; + +_vehicle = _this select 0; +_side = _this select 1; +_type = typeOf _vehicle; +_isAir = if (_vehicle isKindOf "Air") then {true} else {false}; + +//rearming turrets. +{_vehicle removeMagazine _x} forEach magazines _vehicle; + +_magazines = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "Magazines"); +_magazines = _magazines + getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Magazines"); + +{_vehicle addMagazine _x} forEach _magazines; + +/* CM Parameter */ +if (paramCounterMeasures && _isAir) then { + _amount = if (_vehicle isKindOf "Plane") then {'WFBE_COUNTERMEASUREPLANES' Call GetNamespace} else {'WFBE_COUNTERMEASURECHOPPERS' Call GetNamespace}; + _vehicle setVariable ["FlareCount", _amount]; +}; + +_vehicle setVehicleAmmo 1; +reload _vehicle; + +/* Are we dealing with an artillery unit ? */ +_isArtillery = -1; +if (_side == west || _side == east) then {_isArtillery = [_type,_side] Call IsArtillery}; +if (_isArtillery != -1) then {[_vehicle,_isArtillery,_side] Call EquipArtillery}; + +/* Balanced Unit */ +if (_type in ('WFBE_BALANCEDUNITS' Call GetNamespace) && paramBalancing) then {[_vehicle] Call BalanceInit}; + +/* EASA Module */ +if (paramEASA) then { + if (_type in ('WFBE_EASA_Vehicles' Call GetNamespace)) then { + _get = _vehicle getVariable 'WFBE_EASA_Setup'; + if !(isNil '_get') then {[_vehicle,0] Call EASA_Equip}; + }; +}; -- cgit v1.3.1