ACE3/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf
johnb432 cd66f495ad
CSW - Improve tripod and weapon disassembly (#9915)
* Add disassembly for tripods when players have occupied launcher slots

* Update fnc_assemble_canDeployWeapon.sqf

* Update fnc_assemble_canPickupWeapon.sqf

* Revert file renaming (see #9777)

* Correct headers

* Update fnc_canPickupTripod.sqf

* Fixed checks and eject dead bodies

* Invert checks
2024-06-22 19:39:36 +02:00

24 lines
673 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: tcvm
* If the CSW is mounted or in use this will not allow you to dismount the weapon
*
* Arguments:
* 0: Static Weapon <OBJECT>
*
* Return Value:
* Can Dismount <BOOL>
*
* Example:
* [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon
*
* Public: No
*/
params ["_staticWeapon"];
// Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default]
private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]);
_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return