Skip to content

Commit e7a034f

Browse files
Marking Laser - Handle bad laser data (#11174)
* Marking Laser - Handle bad laser data * Update addons/laser/functions/fnc_findLaserSource.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
1 parent 91c4bd7 commit e7a034f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

addons/common/functions/fnc_removeActionEventHandler.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _actionIDs = _actionIDs - [-1];
3939
_actions set [_id, []];
4040
_actions = _actions - [[]];
4141

42-
if (count _actions == 0) then {
42+
if (_actions isEqualTo []) then {
4343
_unit removeAction _actionID;
4444
_actionID = -1;
4545
};

addons/laser/functions/fnc_findLaserSource.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ _methodArgs params ["_ownerSelection"];
2424
private _targetObject = _vehicle getVariable [QGVAR(targetObject), objNull];
2525
private _targetPos = getPosASL _targetObject;
2626

27-
if(isNull _targetObject) exitWith {
27+
if (isNull _targetObject) exitWith {
2828
WARNING_1("Laser is null [%1]",_targetObject);
29-
[-1,-1]
29+
[-1, -1]
3030
};
3131

3232
if (surfaceIsWater _targetPos && {(_targetPos select 2) < 0}) then {

addons/markinglaser/functions/fnc_renderPFH.sqf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ if (((currentVisionMode focusOn) != 1) || {EGVAR(laser,laserEmitters) isEqualTo
3333
_cycle > 1/6
3434
}) then { continue };
3535

36-
(_y call EFUNC(laser,findLaserSource)) params ["_laserPosASL", "_laserDir"];
36+
private _laser = _y call EFUNC(laser,findLaserSource);
37+
if ((_laser isEqualTo []) || {_laser isEqualTo [-1, -1]}) then { continue };
38+
_laser params ["_laserPosASL", "_laserDir"];
3739

3840
#ifdef DEBUG_MODE_FULL
3941
private _targetObject = _aircraft getVariable [QEGVAR(laser,targetObject), objNull];

0 commit comments

Comments
 (0)