From 993423e8d2fd5f4055174171624e3821ebe49821 Mon Sep 17 00:00:00 2001 From: ColdEvul Date: Mon, 15 Jul 2019 20:59:30 +0200 Subject: [PATCH] Rename and adjustments --- addons/safemode/XEH_PREP.hpp | 2 +- .../{fn_safeWeapon.sqf => fn_setWeaponSafety.sqf} | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) rename addons/safemode/functions/{fn_safeWeapon.sqf => fn_setWeaponSafety.sqf} (72%) diff --git a/addons/safemode/XEH_PREP.hpp b/addons/safemode/XEH_PREP.hpp index f32591bc018..2f23aa02c9e 100644 --- a/addons/safemode/XEH_PREP.hpp +++ b/addons/safemode/XEH_PREP.hpp @@ -3,4 +3,4 @@ PREP(lockSafety); PREP(playChangeFiremodeSound); PREP(setSafeModeVisual); PREP(unlockSafety); -PREP(safeWeapon); +PREP(setWeaponSafety); diff --git a/addons/safemode/functions/fn_safeWeapon.sqf b/addons/safemode/functions/fn_setWeaponSafety.sqf similarity index 72% rename from addons/safemode/functions/fn_safeWeapon.sqf rename to addons/safemode/functions/fn_setWeaponSafety.sqf index 2d4d75390f0..7aaaf6cfb3d 100644 --- a/addons/safemode/functions/fn_safeWeapon.sqf +++ b/addons/safemode/functions/fn_setWeaponSafety.sqf @@ -4,30 +4,30 @@ * * Arguments: * 0: Unit - * 1: Weapon - * 2: Muzzle * 3: State * * Return Value: * None * * Example: - * [ACE_player, currentWeapon ACE_player, currentMuzzle Ace_player, true] call ace_safemode_fnc_safeWeapon + * [ACE_player, true] call ace_safemode_fnc_safeWeapon * * Public: yes */ params [ ["_unit", objNull, [objNull]], - ["_weapon", "", [""]], - ["_muzzle", "", [""]], ["_state", true, [true]] ]; private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _weapon = currentWeapon _unit; _weapon = configName (configFile >> "CfgWeapons" >> _weapon); +private _muzzle = currentMuzzle _unit; +_muzzle = configName (configFile >> "CfgWeapons" >> _muzzle); + if !(_state isEqualTo (_weapon in _safedWeapons)) then { [_unit, _weapon, _muzzle] call FUNC(lockSafety); };