ACE3/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf
2023-12-18 17:47:01 +01:00

26 lines
728 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: CSW <OBJECT>
*
* Return Value:
* Can dismount weapon <BOOL>
*
* Example:
* [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon
*
* Public: No
*/
params ["_vehicle"];
// Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default]
private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]);
private _notCrewed = (crew _vehicle) isEqualTo [];
private _deadCrew = !(alive (gunner _vehicle)); // need to eject body???
_assemblyMode && {alive _vehicle} && {_notCrewed || _deadCrew}