Skip to content

Commit

Permalink
avoid PCTW error on certain vehicles (#4463)
Browse files Browse the repository at this point in the history
fix #4413
  • Loading branch information
commy2 authored and thojkooi committed Oct 8, 2016
1 parent 4c96278 commit 74dfa6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/laserpointer/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions addons/nametags/functions/fnc_onDraw3d.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 74dfa6c

Please sign in to comment.