mirror of
https://github.com/SnarkIndustries/A3XAI-Final.git
synced 2024-08-30 17:22:13 +00:00
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
#include "\A3XAI\globaldefines.hpp"
|
|
|
|
private ["_unitGroup", "_vehicle", "_targetPlayer", "_cargoAvailable", "_vehiclePos"];
|
|
|
|
_unitGroup = _this select 0;
|
|
_vehicle = _this select 1;
|
|
_targetPlayer = _this select 2;
|
|
|
|
_vehiclePos = getPosATL _vehicle;
|
|
|
|
if (surfaceIsWater _vehiclePos) exitWith {
|
|
if (A3XAI_debugLevel > 0) then {
|
|
diag_log format ["A3XAI Debug: Group %1 cannot deploy paradrop group at %2 due to water position.",_unitGroup,_vehiclePos];
|
|
};
|
|
};
|
|
|
|
// _cargoAvailable = (_vehicle emptyPositions "cargo") min A3XAI_paraDropAmount;
|
|
_cargoAvailable = 1 max A3XAI_paraDropAmount;
|
|
if (_cargoAvailable > 0) then {
|
|
if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: %1 group %2 has enough cargo positions for successful paradrop. Spawning new group.",typeOf _vehicle,_unitGroup];};
|
|
|
|
_nul = _vehicle spawn {
|
|
_this allowDamage false;
|
|
uiSleep 5;
|
|
_this allowDamage true;
|
|
};
|
|
|
|
if (isDedicated) then {
|
|
[_vehicle,_unitGroup,_cargoAvailable,_targetPlayer] call A3XAI_addParaGroup;
|
|
} else {
|
|
A3XAI_addParaGroup_PVS = [_vehicle,_unitGroup,_cargoAvailable,_targetPlayer];
|
|
publicVariableServer "A3XAI_addParaGroup_PVS";
|
|
};
|
|
};
|