A3XAI-Final/A3XAI/compile/A3XAI_heliParaDrop.sqf
Snark Industries c4a7084754 A3XAI Final Release (April 17, 2016 version)
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
2017-07-19 21:20:00 -04:00

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";
};
};