From d1b8595c0ed938a88bbf21405ce0319f3456da24 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 7 Apr 2015 23:02:54 +0200 Subject: [PATCH] light intensity from object: handle campfires --- addons/common/functions/fnc_lightIntensityFromObject.sqf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index f9749ab8a0..98e7935f9f 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -96,6 +96,14 @@ if (_lightSource isKindOf "CAManBase") then { } forEach _lights; + // handle campfires + if (inflamed _lightSource) then { + private "_distance"; + _distance = _unitPos distance position _lightSource; + + _lightLevel = _lightLevel max linearConversion [0, 30, _distance, 0.5, 0, true]; + }; + }; _lightLevel