diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index 07b8055f0e..2a75a54e03 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -2,8 +2,13 @@ class CfgVehicles { class All; class LaserTarget: All { - class EventHandlers { - init = QUOTE(_this call FUNC(laser_init)); - }; + // LaserTargets are not visual unless in the visual spectrum + model = ""; + threat[] = {0,0,0}; + }; + + // Visual laserTarget override + class ACE_LaserTarget_Visual : LaserTarget { + model = "\A3\Weapons_f\laserTgt.p3d"; }; }; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf index a432b838d8..ac1ae7e438 100644 --- a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf +++ b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf @@ -1,4 +1,15 @@ -//findLaserSource.sqf +/* + * Author: jaynus + * Handler function for laser network code. + * + * Argument: + * 0: Emitter + * 1: Owner + * + * Return value: + * [position, direction] + */ + //findLaserSource.sqf //#define DEBUG_MODE_FULL #include "script_component.hpp" diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index 8df58f01bb..17e7fcb76e 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -1,3 +1,15 @@ +/* + * Author: jaynus + * Turns off passed laser self designation. + * + * Argument: + * 0: Shooter, player shooting the laser + * 1: LaserUUID, the UUID of the laser returned by EFUNC(laser,laserOn) + * 2: Local laser target, unused. + * + * Return value: + * true + */ #include "script_component.hpp" if( (count _this) > 2) then { diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 85fef8f059..0480e9f748 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -1,4 +1,14 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus + * Turns on laser self designation from this vehicle based on the turret. + * There are no arguments, because it is all strictly based on the users vehicle. + * + * Argument: + * + * Return value: + * N/A + */ + //#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); @@ -14,7 +24,7 @@ FUNC(laserHudDesignatePFH) = { _vehicle = vehicle _shooter; TRACE_1("", _args); - if((vehicle _shooter) == _shooter || !alive _shooter || isNull _vehicle || !GVAR(active) ) exitWith { + if((vehicle _shooter) == _shooter || {!alive _shooter} || {isNull _vehicle} || {!GVAR(active)} ) exitWith { _args call FUNC(laserHudDesignateOff); }; if(!([_shooter] call FUNC(unitTurretHasDesignator)) ) exitWith { @@ -35,18 +45,8 @@ FUNC(laserHudDesignatePFH) = { TRACE_1("Search", _laserResult); if((count _laserResult) > 0) then { - // If the laser has moved less than a half meter, then dont move it. - // Just regular use of lasers will commonly make them move this much, - // but not across multiple close frames. - // This loses accuracy a little, but saves position updates per frame. - TRACE_4("", diag_tickTime, _forceUpdateTime, _laserResultPosition, (_laserResultPosition vectorDistance _pos)); - if(diag_tickTime > _forceUpdateTime) then { - TRACE_1("FCS Update", ""); ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent; - }; - - if(diag_tickTime > _forceUpdateTime) then { _args set[3, diag_tickTime + FCS_UPDATE_DELAY]; }; @@ -67,7 +67,7 @@ if(!GVAR(active)) then { GVAR(active) = true; TRACE_1("Activating laser", ""); - _laserUuid = [(vehicle ACE_player), ACE_player, FUNC(findLaserSource), 1550, 1001, 1] call EFUNC(laser,laserOn); + _laserUuid = [(vehicle ACE_player), ACE_player, QFUNC(findLaserSource), 1550, 1001, 1] call EFUNC(laser,laserOn); // @TODO: Create the local target for the players side // @TODO: Nou gets to field all tickets about missing lasers.