From e683c524d7da44d70e45bc1ec201a2d71c709ae9 Mon Sep 17 00:00:00 2001 From: Dystopian Date: Tue, 13 Feb 2018 22:27:57 +0300 Subject: [PATCH] Map - Add Camping Light support (#6087) * Add Camping Light support * Add intensity check --- .../functions/fnc_lightIntensityFromObject.sqf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 6725a71580..4991370f5d 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -79,6 +79,21 @@ if (_lightSource isKindOf "CAManBase") then { } forEach _lights; + if (isCollisionLightOn _lightSource) then { + private _markerLights = [ + _lightSource, + {configProperties [configFile >> "CfgVehicles" >> typeOf _this >> "MarkerLights", "isClass _x", true]}, + uiNamespace, + format [QEGVAR(cache,MarkerLights_%1), typeOf _lightSource], + 1E11 + ] call FUNC(cachedCall); + { + private _position = _lightSource modelToWorld (_lightSource selectionPosition getText (_x >> "name")); + private _distance = _unitPos distance _position; + _lightLevel = _lightLevel max (linearConversion [0, 10, _distance, 1, 0, true] * linearConversion [0, 1300, getNumber (_x >> "intensity"), 0, 1, true]); + } forEach _markerLights; + }; + // handle campfires if (inflamed _lightSource) then { private _distance = _unitPos distance position _lightSource;