Skip to content

Commit

Permalink
Map - Add Camping Light support (#6087)
Browse files Browse the repository at this point in the history
* Add Camping Light support

* Add intensity check
  • Loading branch information
Dystopian authored and PabstMirror committed Feb 13, 2018
1 parent 794b621 commit 9d0bc1c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions addons/common/functions/fnc_lightIntensityFromObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9d0bc1c

Please sign in to comment.