fix no laser in ffv slots

This commit is contained in:
commy2 2015-04-14 13:24:17 +02:00
parent 83ce3fa2bd
commit f89e02a5ca
2 changed files with 23 additions and 16 deletions

View File

@ -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"

View 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;