2015-04-12 21:12:21 +00:00
|
|
|
//#define DEBUG_MODE_FULL
|
2015-01-11 18:24:19 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
TRACE_1("enter", _this);
|
|
|
|
|
2015-04-12 21:03:15 +00:00
|
|
|
PARAMS_1(_laserTarget);
|
2015-04-18 17:57:11 +00:00
|
|
|
private["_uuid"];
|
2015-04-12 21:03:15 +00:00
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
// Add the target to the global targets array
|
|
|
|
// Everyone tracks them
|
|
|
|
// Add the laser localized to the laser array, and give it the default localized code
|
2015-04-12 21:12:21 +00:00
|
|
|
PUSH(GVAR(VanillaLasers), _laserTarget);
|
2015-04-12 18:01:22 +00:00
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
// Check the vehicle, otherwise use the default
|
2015-04-12 21:03:15 +00:00
|
|
|
_laserTarget setVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE, false];
|
|
|
|
_laserTarget setVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD, false];
|
|
|
|
_laserTarget setVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH, false];
|
2015-04-12 18:01:22 +00:00
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
// Clean the lasers of any null objects while we are here
|
2015-04-12 21:12:21 +00:00
|
|
|
REM(GVAR(VanillaLasers), objNull);
|
2015-01-11 18:24:19 +00:00
|
|
|
|
|
|
|
if(!(local _laserTarget)) exitWith { };
|
2015-04-12 18:01:22 +00:00
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
// The target is local, so its on this client
|
|
|
|
if(!isDedicated) then {
|
2015-04-12 21:03:15 +00:00
|
|
|
// @TODO: Get ownership variables and set them on the vehicle
|
|
|
|
|
|
|
|
_uuid = [(vehicle ACE_player), ACE_player, QFUNC(vanillaLaserSeekerHandler), ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_CODE, ACE_DEFAULT_LASER_BEAMSPREAD] call FUNC(laserOn);
|
|
|
|
_laserTarget setVariable [QGVAR(uuid), _uuid, false];
|
2015-04-12 21:12:21 +00:00
|
|
|
[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call cba_fnc_addPerFrameHandler;
|
2015-01-11 18:24:19 +00:00
|
|
|
} else {
|
2015-04-02 16:35:36 +00:00
|
|
|
// server side ownership of laser
|
2015-04-12 18:01:22 +00:00
|
|
|
_laserTarget setVariable [QGVAR(owner), nil, true];
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|