2015-01-17 22:38:13 +00:00
// by commy2
#include "script_component.hpp"
2015-06-13 08:41:19 +00:00
// fixes laser when being captured. Needed, because the selectionPosition of the right hand is used
2016-06-03 15:02:21 +00:00
[QEGVAR(captives,setHandcuffed), {if (_this select 1) then {(_this select 0) action ["ace_gunLightOff", _this select 0]};}] call CBA_fnc_addEventHandler;
2015-04-07 17:38:19 +00:00
2015-09-11 14:58:26 +00:00
if (!hasInterface) exitWith {};
2015-01-18 02:48:44 +00:00
2015-01-17 22:38:13 +00:00
GVAR(nearUnits) = [];
2015-04-14 11:24:17 +00:00
#include "initKeybinds.sqf"
2015-06-12 05:58:04 +00:00
2016-05-24 13:13:11 +00:00
["ace_settingsInitialized", {
2015-06-12 05:58:04 +00:00
//If not enabled, dont't add draw eventhandler or PFEH (for performance)
if (!GVAR(enabled)) exitWith {};
// @todo. Maybe move to common?
[{
2016-10-08 10:45:40 +00:00
// handle RHS / bugged vehicle slots
private _camPosAGL = positionCameraToWorld [0,0,0];
if !((_camPosAGL select 0) isEqualType 0) exitWith {};
2016-09-04 14:44:22 +00:00
private _nearUnits = [];
2015-06-12 05:58:04 +00:00
{
_nearUnits append crew _x;
if (count _nearUnits > 10) exitWith {
_nearUnits resize 10;
};
2016-10-08 10:45:40 +00:00
} forEach nearestObjects [_camPosAGL, ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV
2015-06-12 05:58:04 +00:00
GVAR(nearUnits) = _nearUnits;
2015-08-16 11:15:01 +00:00
2015-06-12 05:58:04 +00:00
} , 5, []] call CBA_fnc_addPerFrameHandler;
addMissionEventHandler ["Draw3D", {
call FUNC(onDraw);
}];
2016-05-22 15:29:05 +00:00
}] call CBA_fnc_addEventHandler;