summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_RearmVehicleOA.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
commit628d33984d9228f1781d13a65fbb80f35facc899 (patch)
treecd909141f87e14f22c3511549a9bc067d9ff8b50 /Common/Functions/Common_RearmVehicleOA.sqf
downloada2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip
init
Diffstat (limited to 'Common/Functions/Common_RearmVehicleOA.sqf')
-rw-r--r--Common/Functions/Common_RearmVehicleOA.sqf51
1 files changed, 51 insertions, 0 deletions
diff --git a/Common/Functions/Common_RearmVehicleOA.sqf b/Common/Functions/Common_RearmVehicleOA.sqf
new file mode 100644
index 0000000..9537b90
--- /dev/null
+++ b/Common/Functions/Common_RearmVehicleOA.sqf
@@ -0,0 +1,51 @@
+Private['_amount','_config','_get','_isAir','_isArtillery','_magazines','_side','_turrets','_type','_vehicle'];
+
+_vehicle = _this select 0;
+_side = _this select 1;
+_type = typeOf _vehicle;
+_isAir = if (_vehicle isKindOf "Air") then {true} else {false};
+
+/* Clear the vehicle */
+_vehicle setVehicleAmmo 0;
+
+/* Reload all turrets */
+_turrets = [];
+_config = configFile >> 'CfgVehicles' >> typeOf _vehicle >> 'Turrets';
+_turrets = [_config] call GetTurretsMags;
+[_vehicle,_turrets] Call SetTurretsMags;
+/* Reload the driver (Special) */
+_magazines = [configFile >> 'CfgVehicles' >> typeOf _vehicle] call GetVehicleMags;
+{_vehicle addMagazineTurret[_x,[-1]]} forEach _magazines;
+
+reload _vehicle;
+
+/* CM Parameter */
+if (paramCounterMeasures && _vehicle isKindOf 'Air') then {
+ _amount = if (_vehicle isKindOf 'Plane') then {'WFBE_COUNTERMEASUREPLANES' Call GetNamespace} else {'WFBE_COUNTERMEASURECHOPPERS' Call GetNamespace};
+ _vehicle setVariable ['FlareCount', _amount];
+};
+
+/* 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};
+ };
+};
+
+/* Mando Missiles - Reload Flares */
+if (paramMandoMissiles && _isAir) then {
+ _var = _vehicle getVariable "mando_maxflares";
+ if !(isNil "_var") then {
+ _vehicle setVariable ["mando_flaresleft", _var, true];
+ call mando_update_flares;
+ };
+}; \ No newline at end of file