From ec3953435ae42362722b4a3ce2465ad02471c637 Mon Sep 17 00:00:00 2001 From: He-Man Date: Sat, 6 Jan 2018 15:11:57 +0100 Subject: [PATCH] Fix nitelight not working inside Vehicles --- Sources/epoch_code/compile/EPOCH_niteLight.sqf | 4 ++-- Sources/epoch_code/compile/event_handlers/EPOCH_getInMan.sqf | 1 + Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_niteLight.sqf b/Sources/epoch_code/compile/EPOCH_niteLight.sqf index aa0d3385..31426b76 100644 --- a/Sources/epoch_code/compile/EPOCH_niteLight.sqf +++ b/Sources/epoch_code/compile/EPOCH_niteLight.sqf @@ -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. diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_getInMan.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_getInMan.sqf index 3d56bade..efb22de8 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_getInMan.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_getInMan.sqf @@ -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 { diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf index 1f4d9767..b43ad244 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_getOutMan.sqf @@ -15,6 +15,7 @@ */ params ["_unit","_position","_vehicle"]; +call EPOCH_niteLight; if (_unit == player) then { _this spawn { private ["_animationstate","_StartTime","_eyepos","_dirTo","_end","_start"];