2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-04-07 13:06:27 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Returns all turned on lights of any vehicle or streetlamp.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-09-21 11:08:10 +00:00
|
|
|
* 0: Vehicle <OBJECT>
|
2015-04-07 13:06:27 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-09-21 11:08:10 +00:00
|
|
|
* All burning lights <ARRAY>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [car] call ace_common_fnc_getTurnedOnLights
|
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Public: Yes
|
2015-04-07 13:06:27 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-21 11:08:10 +00:00
|
|
|
params ["_vehicle"];
|
2015-04-07 13:06:27 +00:00
|
|
|
|
|
|
|
if (!isLightOn _vehicle) exitWith {[]};
|
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall);
|
2015-04-07 19:42:08 +00:00
|
|
|
//_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections);
|
2015-04-07 13:06:27 +00:00
|
|
|
|
2015-12-12 16:26:47 +00:00
|
|
|
_reflectorsWithSelections params ["_lights", "_hitpoints"];
|
2015-04-07 13:06:27 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _turnedOnLights = [];
|
2015-09-21 11:08:10 +00:00
|
|
|
|
2015-04-07 13:06:27 +00:00
|
|
|
{
|
|
|
|
if (_vehicle getHit _x <= 0.9) then {
|
|
|
|
_turnedOnLights pushBack (_lights select _forEachIndex);
|
|
|
|
};
|
|
|
|
} forEach _hitpoints;
|
|
|
|
|
|
|
|
_turnedOnLights
|