Skip to content

Commit

Permalink
Move keybinds
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Apr 10, 2024
1 parent f37e5f9 commit 192e4d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions addons/scopes/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

if (!hasInterface) exitWith {};

// Add keybinds
#include "initKeybinds.inc.sqf"

GVAR(Optics) = ["", "", ""];
GVAR(Guns) = ["", "", ""];
GVAR(canAdjustElevation) = [false, false, false];
Expand Down Expand Up @@ -41,9 +44,6 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]];
};
}] call CBA_fnc_addPlayerEventHandler;

// Add keybinds
#include "initKeybinds.inc.sqf"

// Register fire event handler
["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
Expand Down
3 changes: 2 additions & 1 deletion addons/scopes/functions/fnc_adjustScope.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
* Public: No
*/

if (!GVAR(enabled)) exitWith {false};

params ["_unit", "_turretAndDirection", "_majorStep"];
TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep);

if (!(_unit isKindOf "Man")) exitWith {false};
if (currentMuzzle _unit != currentWeapon _unit) exitWith {false};
if (!GVAR(enabled)) exitWith {false};

private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};
Expand Down

0 comments on commit 192e4d1

Please sign in to comment.