2015-05-14 00:06:10 +00:00
|
|
|
//#define DEBUG_MODE_FULL
|
2015-05-13 21:33:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-06-19 03:43:49 +00:00
|
|
|
private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"];
|
2015-05-14 00:06:10 +00:00
|
|
|
PARAMS_3(_gun,_type,_round);
|
2015-06-19 03:43:49 +00:00
|
|
|
DEFAULT_PARAM(3,_doFragTrack,false);
|
2015-05-13 21:33:14 +00:00
|
|
|
|
|
|
|
if (!GVAR(enabled)) exitWith {};
|
|
|
|
|
2015-05-14 00:06:10 +00:00
|
|
|
//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
|
|
|
|
//if(_enabled < 1) exitWith {};
|
2015-05-13 21:33:14 +00:00
|
|
|
|
|
|
|
if(_round in GVAR(blackList)) exitWith {
|
|
|
|
GVAR(blackList) = GVAR(blackList) - [_round];
|
|
|
|
};
|
|
|
|
|
2015-05-14 00:06:10 +00:00
|
|
|
// Exit on max track
|
|
|
|
if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { };
|
|
|
|
|
2015-05-13 21:33:14 +00:00
|
|
|
if(_gun == ACE_player) then {
|
|
|
|
_doFragTrack = true;
|
|
|
|
} else {
|
|
|
|
if((gunner _gun) == ACE_player) then {
|
|
|
|
_doFragTrack = true;
|
|
|
|
} else {
|
|
|
|
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
|
|
|
|
_doFragTrack = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-06-19 03:04:48 +00:00
|
|
|
|
|
|
|
_doSpall = false;
|
2015-05-14 00:06:10 +00:00
|
|
|
if(GVAR(SpallEnabled)) then {
|
2015-05-13 21:33:14 +00:00
|
|
|
if(GVAR(spallIsTrackingCount) <= 0) then {
|
|
|
|
GVAR(spallHPData) = [];
|
|
|
|
};
|
|
|
|
if(GVAR(spallIsTrackingCount) > 5) then {
|
|
|
|
// ACE_player sideChat "LIMT!";
|
|
|
|
} else {
|
2015-06-19 03:04:48 +00:00
|
|
|
_doSpall = true;
|
2015-05-13 21:33:14 +00:00
|
|
|
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
|
|
|
|
|
2015-05-14 00:06:10 +00:00
|
|
|
if(GVAR(autoTrace)) then {
|
|
|
|
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
|
|
|
|
};
|
2015-05-13 21:33:14 +00:00
|
|
|
|
|
|
|
// We only do the single track object check here.
|
2015-06-19 03:04:48 +00:00
|
|
|
// We should do an {!(_round in GVAR(objects))}
|
2015-05-14 00:06:10 +00:00
|
|
|
// But we leave that out here for optimization. So this cannot be a framework function
|
|
|
|
// Otherwise, it should only be added once and from the FiredEH
|
|
|
|
if(_doFragTrack && alive _round) then {
|
2015-05-13 21:33:14 +00:00
|
|
|
_spallTrack = [];
|
|
|
|
_spallTrackID = [];
|
2015-06-19 03:04:48 +00:00
|
|
|
|
2015-05-13 21:33:14 +00:00
|
|
|
private["_args"];
|
2015-05-21 22:06:55 +00:00
|
|
|
_args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
|
2015-06-19 03:04:48 +00:00
|
|
|
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
|
|
|
|
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
|
|
|
|
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
|
|
|
|
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
|
|
|
|
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
|
|
|
|
];
|
2015-05-14 00:06:10 +00:00
|
|
|
TRACE_1("Initializing track", _round);
|
2015-05-13 21:33:14 +00:00
|
|
|
GVAR(objects) pushBack _round;
|
|
|
|
GVAR(arguments) pushBack _args;
|
2015-06-19 03:04:48 +00:00
|
|
|
|
2015-05-13 21:33:14 +00:00
|
|
|
if(_doSpall) then {
|
2015-05-14 00:06:10 +00:00
|
|
|
[_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack);
|
2015-05-13 21:33:14 +00:00
|
|
|
};
|
|
|
|
// ACE_player sideChat "WTF2";
|
|
|
|
};
|