diff --git a/addons/map/CfgWeapons.hpp b/addons/map/CfgWeapons.hpp index 1e4ab801f7..c7f350a454 100644 --- a/addons/map/CfgWeapons.hpp +++ b/addons/map/CfgWeapons.hpp @@ -5,7 +5,7 @@ class CfgWeapons { class acc_flashlight: ItemCore { class ItemInfo: InventoryFlashlightItem_Base_F { - class Flashlight { + class FlashLight { ACE_Flashlight_Colour = "white"; ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa); ACE_Flashlight_Size = 2.75; diff --git a/addons/map/functions/fnc_flashlightGlow.sqf b/addons/map/functions/fnc_flashlightGlow.sqf index 10cf1fbb46..565182c2a6 100644 --- a/addons/map/functions/fnc_flashlightGlow.sqf +++ b/addons/map/functions/fnc_flashlightGlow.sqf @@ -16,19 +16,18 @@ #include "script_component.hpp" -private ["_light", "_color", "_class"]; params ["_flashlight"]; -_light = GVAR(glow); +private _light = GVAR(glow); if (!isNull _light) then { detach _light; deleteVehicle _light; }; if (_flashlight != "") then { - _color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight" >> "ACE_Flashlight_Colour"); + private _color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); if !(_color in ["white", "red", "green", "blue", "yellow", "orange"]) then {_color = "white"}; - _class = format["ACE_FlashlightProxy_%1", _color]; + private _class = format["ACE_FlashlightProxy_%1", _color]; _light = _class createVehicle [0,0,0]; _light attachTo [ACE_player, [0,0.1,-0.05], "neck"]; diff --git a/addons/map/functions/fnc_getUnitFlashlights.sqf b/addons/map/functions/fnc_getUnitFlashlights.sqf index 953a2c53e9..cdd1bba28b 100644 --- a/addons/map/functions/fnc_getUnitFlashlights.sqf +++ b/addons/map/functions/fnc_getUnitFlashlights.sqf @@ -18,4 +18,12 @@ params ["_unit"]; -(items _unit) select {isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "Flashlight" >> "ACE_Flashlight_Colour")} \ No newline at end of file +private _flashlights = []; + +{ + if (isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) then { + _flashlights pushBackUnique _x; + }; +} forEach (items _unit); + +_flashlights diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf index 70ad4e715a..30a9802e54 100644 --- a/addons/map/functions/fnc_simulateMapLight.sqf +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -56,7 +56,7 @@ if (_flashlight == "") then { _mousePos = GVAR(mousePos); //flashlight settings - _cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight"); + _cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight"); _size = getNumber (_cfg >> "ACE_Flashlight_Size"); _flashTex = getText (_cfg >> "ACE_Flashlight_Beam"); _beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size; diff --git a/addons/map/functions/fnc_switchFlashlight.sqf b/addons/map/functions/fnc_switchFlashlight.sqf index 645bf11380..e7843e5fa1 100644 --- a/addons/map/functions/fnc_switchFlashlight.sqf +++ b/addons/map/functions/fnc_switchFlashlight.sqf @@ -24,8 +24,8 @@ if (GVAR(mapGlow)) then { }; if ( - (getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0) || - {getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0} + (getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0) || + {getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0} ) then { playSound QGVAR(flashlightClick); };