mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
ab6fc8efca
* 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
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
/*
|
|
* Author: esteldunedain
|
|
* Associates a newly created laser target to it's owner
|
|
*
|
|
* Argument:
|
|
* 0: Vanilla Laser (base type LaserTarget) <OBJECT>
|
|
*
|
|
* Return value:
|
|
* None
|
|
*
|
|
* Return value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [laserTarget player] call ace_laser_fnc_handleLaserTargetCreation;
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
TRACE_1("params",_this);
|
|
[{
|
|
params ["_targetObject"];
|
|
|
|
// Only handle locally created lasers
|
|
if(!(local _targetObject)) exitWith {TRACE_1("not local",_targetObject);};
|
|
|
|
private _owners = allUnits select {(lasertarget _x) == _targetObject};
|
|
if (count _owners == 1) exitWith {
|
|
TRACE_2("Laser target owner [allUnits]", _targetObject, _owners select 0);
|
|
[_targetObject, _owners select 0] call FUNC(addLaserTarget);
|
|
};
|
|
|
|
_owners = vehicles select {(lasertarget _x) == _targetObject};
|
|
if (count _owners == 1) exitWith {
|
|
TRACE_2("Laser target owner [vehicles]", _targetObject, _owners select 0);
|
|
[_targetObject, _owners select 0] call FUNC(addLaserTarget);
|
|
};
|
|
|
|
TRACE_1("Laser target doesn't have owner", _targetObject);
|
|
}, _this] call CBA_fnc_execNextFrame;
|