2015-01-11 18:24:19 +00:00
|
|
|
#include "script_component.hpp"
|
2015-04-26 21:14:54 +00:00
|
|
|
|
2015-05-08 18:27:17 +00:00
|
|
|
private ["_enabled", "_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"];
|
2015-04-26 21:14:54 +00:00
|
|
|
|
|
|
|
if (!GVAR(enabled)) exitWith {};
|
2015-01-11 18:24:19 +00:00
|
|
|
|
|
|
|
_gun = _this select 0;
|
|
|
|
_type = _this select 4;
|
|
|
|
_round = _this select 6;
|
|
|
|
|
2015-05-08 18:27:17 +00:00
|
|
|
_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
|
|
|
|
if(_enabled < 1) exitWith {};
|
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
if(_round in GVAR(blackList)) exitWith {
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(blackList) = GVAR(blackList) - [_round];
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|
|
|
|
|
2015-05-08 18:27:17 +00:00
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
_doFragTrack = false;
|
2015-04-20 20:48:11 +00:00
|
|
|
if(_gun == ACE_player) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
_doFragTrack = true;
|
2015-01-11 18:24:19 +00:00
|
|
|
} else {
|
2015-04-20 20:48:11 +00:00
|
|
|
if((gunner _gun) == ACE_player) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
_doFragTrack = true;
|
|
|
|
} else {
|
|
|
|
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
|
|
|
|
_doFragTrack = true;
|
|
|
|
};
|
|
|
|
};
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|
2015-03-22 04:22:16 +00:00
|
|
|
_doSpall = false;
|
2015-01-11 18:24:19 +00:00
|
|
|
if(_doSpall) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
if(GVAR(spallIsTrackingCount) <= 0) then {
|
|
|
|
GVAR(spallHPData) = [];
|
|
|
|
};
|
|
|
|
if(GVAR(spallIsTrackingCount) > 5) then {
|
2015-04-20 20:48:11 +00:00
|
|
|
// ACE_player sideChat "LIMT!";
|
2015-04-06 16:22:43 +00:00
|
|
|
_doSpall = false;
|
|
|
|
} else {
|
|
|
|
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
|
|
|
|
};
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|
2015-04-20 20:48:11 +00:00
|
|
|
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
|
2015-04-20 21:38:50 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_MODE_FULL
|
2015-04-20 20:48:11 +00:00
|
|
|
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
|
2015-04-20 21:38:50 +00:00
|
|
|
#endif
|
|
|
|
|
2015-01-11 18:24:19 +00:00
|
|
|
if(_doFragTrack && alive _round) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(trackedObjects) pushBack _round;
|
|
|
|
_spallTrack = [];
|
|
|
|
_spallTrackID = [];
|
|
|
|
[DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler;
|
|
|
|
if(_doSpall) then {
|
|
|
|
[_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack);
|
|
|
|
};
|
2015-04-20 20:48:11 +00:00
|
|
|
// ACE_player sideChat "WTF2";
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|