ACE3/addons/advancedthrowing/functions/fnc_canPrepare.sqf
jonpas f8dfa4f933 Add Advanced Throwing (#3477)
* Add Advanced Throwing

* Add feature documentation
2016-08-22 15:09:08 +02:00

32 lines
806 B
Plaintext

/*
* Author: Jonpas
* Checks if a throwable can be prepared.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Can Prepare <BOOL>
*
* Example:
* [unit] call ace_advancedthrowing_fnc_canPrepare
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
GVAR(enabled) &&
#ifndef DEBUG_MODE_FULL
{_unit getVariable [QGVAR(lastThrownTime), CBA_missionTime - 3] < CBA_missionTime - 2} && // Prevent throwing in quick succession
#else
{true} &&
#endif
{!(call EFUNC(common,isFeatureCameraActive))} &&
{!EGVAR(common,isReloading)} &&
{[_unit, objNull, ["isNotInside", "isNotSitting"/*, "isNotOnLadder"*/]] call EFUNC(common,canInteractWith)} && // Ladder needs positioning fixes on throw
{_unit call CBA_fnc_canUseWeapon} // Disable in non-FFV seats due to surface detection issues