From 253ed6946e3f270db9c21ecdb622b5a09f4472f6 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sat, 9 May 2015 20:02:22 +0200 Subject: [PATCH] scope firedEH cleanup --- addons/scopes/functions/fnc_firedEH.sqf | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 1b692e340a..020431c27b 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -18,25 +18,20 @@ */ #include "script_component.hpp" -private ["_unit", "_adjustment", "_weapon", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; - +private ["_unit", "_adjustment", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; _unit = _this select 0; -_weapon = _this select 1; _projectile = _this select 6; -// Exit if the unit doesn't have any adjusment variable +if !([_unit] call EFUNC(common,isPlayer)) exitWith {}; + _adjustment = _unit getVariable [QGVAR(Adjustment), []]; if (_adjustment isEqualTo []) exitWith {}; -// Exit if the unit isn't a player -if !([_unit] call EFUNC(common,isPlayer)) exitWith {}; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; _zeroing = _adjustment select _weaponIndex; -//Exit if adjusment is zero: if (_zeroing isEqualTo [0,0,0]) exitWith {}; // Convert zeroing from mils to degrees