mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Check if the unit can interact.
|
|
*
|
|
* Arguments:
|
|
* 0: The player. <OBJECT>
|
|
* 1: The interaction target. objNull to ignore. <OBJECT>
|
|
* 2: Exceptions. What general conditions are to skip? (default: []) <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* Unit can interact? <BOOL>
|
|
*
|
|
* Example:
|
|
* [bob, target, []] call ace_common_fnc_canInteractWith
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_unit", "_target", ["_exceptions", []]];
|
|
|
|
_exceptions = _exceptions apply {toLower _x};
|
|
|
|
private _owner = _target getVariable [QGVAR(owner), objNull];
|
|
|
|
// exit if the target is not free to interact
|
|
if (!isNull _owner && {_unit != _owner}) exitWith {false};
|
|
|
|
// check general conditions
|
|
private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
|
|
_conditions params ["_conditionNames", "_conditionFuncs"];
|
|
|
|
private _canInteract = true;
|
|
|
|
{
|
|
if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith {
|
|
_canInteract = false;
|
|
};
|
|
} forEach _conditionNames;
|
|
|
|
_canInteract
|