diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 219c70d372..bfc617965d 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -16,13 +16,17 @@ GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ + // handle RHS / bugged vehicle slots + private _camPosAGL = positionCameraToWorld [0,0,0]; + if !((_camPosAGL select 0) isEqualType 0) exitWith {}; + private _nearUnits = []; { _nearUnits append crew _x; if (count _nearUnits > 10) exitWith { _nearUnits resize 10; }; - } forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV + } forEach nearestObjects [_camPosAGL, ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV GVAR(nearUnits) = _nearUnits; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 7f3f04a0c4..dc4b130a52 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -68,6 +68,8 @@ private _ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, private _maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance); private _camPosAGL = positionCameraToWorld [0, 0, 0]; +if !((_camPosAGL select 0) isEqualType 0) exitWith {}; // handle RHS / bugged vehicle slots + private _camPosASL = AGLtoASL _camPosAGL; private _vecy = (AGLtoASL positionCameraToWorld [0, 0, 1]) vectorDiff _camPosASL;