Skip to content

Commit

Permalink
Fix scoperemover (#37)
Browse files Browse the repository at this point in the history
* Update fn_init.sqf

* Remove remotexec
  • Loading branch information
Seb105 authored Aug 21, 2021
1 parent 067f3e7 commit ab3e943
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/scope_remover/fn_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
true /* needRestart */
] call CBA_settings_fnc_init;

if !(isServer) exitWith {};

["CBA_settingsInitialized", {
if !(cnto_scope_remover_enable) exitWith {};
["CAManBase", "initPost", {
params ["_unit"];
if !(local _unit) exitWith {};
if (primaryWeapon _unit == "" || _unit in playableUnits || isPlayer _unit || _unit in allPlayers) exitWith {};
private _role = getText (configOf _unit >> "displayName");
_role = toLower _role;
Expand All @@ -25,7 +25,7 @@ if !(isServer) exitWith {};
private _opticVisionModes = configProperties [_opticCfg >> "ItemInfo" >> "OpticsModes", "true", true];
private _opticMaxZoom = selectMin (_opticVisionModes apply { getNumber (_x >> "opticsZoomMin") });
if (_opticMaxZoom < 0.25) then {
[_unit, _optic] remoteExec ["removePrimaryWeaponItem"];
_unit removePrimaryWeaponItem _optic;
};
}, true, [], true] call CBA_fnc_addClassEventHandler;
}] call CBA_fnc_addEventHandler;

0 comments on commit ab3e943

Please sign in to comment.