Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map - Add Camping Light support #6087

Merged
merged 2 commits into from
Feb 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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