ACE3/addons/laser/functions/fnc_laserTargetPFH.sqf
Nicolás Badano ab6fc8efca Laser guidance for all designators (#3308)
* Fix laser and missileguidance over water

* Return a normalized vector in EFUNC(common,getTurretDirection)

* Make laser dispersion simulation optional, default off

* Prototype for ace_laser_designate

* Remove vanilla laser handling from ace_laser in favor of the new code on ace_laser_designate

* Simplify laser into one module

Rewrite large parts of laser
Merge laser_designate
Delete lase_selfDesignate

* Cleanup missile guidance

* Headers, fix laser over water

* Cleanup

* Test

* Change setting to scalar, more cleanup

* Add seeker debug drawing
2016-10-08 12:55:30 +02:00

41 lines
927 B
Plaintext

/*
* Author: esteldunedain
* Maintains the tracked lasers, deleting any laser that is turned off
*
* Argument:
* PFEH Args
*
* Return value:
* None
*
* Example:
* [[], 1]] call ace_laser_fnc_laserTargetPFH;
*
* Public: No
*/
#include "script_component.hpp"
params ["", "_pfhuid"];
GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select {
_x params ["_targetObject", "_owner", "_laserUuid"];
if ((isNull _targetObject) ||
{!(alive _targetObject)} ||
{isNull _owner} ||
{!(alive _owner)}) then {
// Turn off the laser in ace_laser
[_laserUuid] call FUNC(laserOff);
TRACE_1("Laser off:", _laserUuid);
false
} else {
true
};
};
if (GVAR(trackedLaserTargets) isEqualTo []) then {
TRACE_1("ending pfeh",count GVAR(trackedLaserTargets));
[_pfhuid] call CBA_fnc_removePerFrameHandler;
GVAR(pfehID) = -1;
};