Map - Add Camping Light support (#6087)

* Add Camping Light support

* Add intensity check
This commit is contained in:
Dystopian 2018-02-13 22:27:57 +03:00 committed by PabstMirror
parent 04191e3c99
commit e683c524d7

View File

@ -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;