Fix nitelight not working inside Vehicles

This commit is contained in:
He-Man 2018-01-06 15:11:57 +01:00
parent c615d93ba6
commit ec3953435a
3 changed files with 4 additions and 2 deletions

View File

@ -22,11 +22,11 @@ _config = 'CfgEpochClient' call EPOCH_returnConfig;
_nlSettings = getArray( _config >> "niteLight");
_nlSettings params [["_nlEnabled",1],["_nlBright",1.88],["_nlZ",22]];
if (_nlEnabled isEqualTo 1) then {
_pos = (getPosATL player);
_pos = (getPosATL vehicle player);
_pos set [2,_nlZ];
EP_light = "#lightpoint" createvehiclelocal _pos;
EP_light setposATL _pos;
EP_light attachTo [player,[0,8.11,_nlZ]]; //offset infront of player so that the darkness is 'following' them.
EP_light attachTo [vehicle player,[0,8.11,_nlZ]]; //offset infront of vehicle player so that the darkness is 'following' them.
EP_light setLightDayLight false; //Sets light so it can only be used at night.
EP_light setLightBrightness _nlBright;
EP_light setLightAmbient [0.435, 0.439, 0.439];//Using new Colours.

View File

@ -13,6 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_getInMan_EH.sqf
*/
params ["_unit","_position","_vehicle"];
call EPOCH_niteLight;
if (_unit == player) then {
// Disable build mode
if (EPOCH_buildMode > 0) then {

View File

@ -15,6 +15,7 @@
*/
params ["_unit","_position","_vehicle"];
call EPOCH_niteLight;
if (_unit == player) then {
_this spawn {
private ["_animationstate","_StartTime","_eyepos","_dirTo","_end","_start"];