mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix no laser in ffv slots
This commit is contained in:
parent
83ce3fa2bd
commit
f89e02a5ca
@ -11,12 +11,17 @@ GVAR(nearUnits) = [];
|
||||
// @todo. Maybe move to common?
|
||||
[{
|
||||
private "_nearUnits";
|
||||
_nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV
|
||||
_nearUnits = [];
|
||||
|
||||
if (count _nearUnits > 10) then {
|
||||
{
|
||||
_nearUnits append crew _x;
|
||||
|
||||
if (count _nearUnits > 10) exitWith {
|
||||
_nearUnits resize 10;
|
||||
};
|
||||
|
||||
} forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV
|
||||
|
||||
GVAR(nearUnits) = _nearUnits;
|
||||
|
||||
} , 5, []] call CBA_fnc_addPerFrameHandler;
|
||||
@ -25,15 +30,4 @@ addMissionEventHandler ["Draw3D", {
|
||||
call FUNC(onDraw);
|
||||
}];
|
||||
|
||||
// init keybinds
|
||||
["ACE3", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
|
||||
|
||||
[ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode);
|
||||
true
|
||||
},
|
||||
{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind;
|
||||
#include "initKeybinds.sqf"
|
||||
|
13
addons/laserpointer/initKeybinds.sqf
Normal file
13
addons/laserpointer/initKeybinds.sqf
Normal file
@ -0,0 +1,13 @@
|
||||
// by commy2
|
||||
|
||||
["ACE3", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
|
||||
|
||||
[ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode);
|
||||
true
|
||||
},
|
||||
{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind;
|
Loading…
Reference in New Issue
Block a user