2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-12 05:28:33 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal, Ruthberg
|
2016-02-06 21:36:20 +00:00
|
|
|
* Handles wind deflection for projectiles. Called from the unified fired EH only for players on foot and their vehicles if required by settings.
|
2015-01-13 17:05:05 +00:00
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Arguments:
|
2016-02-06 21:36:20 +00:00
|
|
|
* None. Parameters inherited from EFUNC(common,firedEH)
|
2015-01-13 17:05:05 +00:00
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-01-13 17:05:05 +00:00
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Example:
|
2020-04-25 06:41:45 +00:00
|
|
|
* [clientFiredBIS-XEH] call ace_winddeflection_fnc_handleFired
|
2015-03-12 05:28:33 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-13 17:05:05 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-06 21:36:20 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret);
|
2015-01-13 17:05:05 +00:00
|
|
|
|
2017-12-02 13:18:35 +00:00
|
|
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {_projectile isKindOf "BulletBase" && {_unit isKindOf "Man"}}) exitWith {false};
|
2015-04-18 19:17:37 +00:00
|
|
|
|
2016-07-24 04:08:40 +00:00
|
|
|
if (!((_projectile isKindOf "BulletBase") || {_projectile isKindOf "GrenadeBase"})) exitWith {false};
|
2017-12-02 13:18:57 +00:00
|
|
|
if (_unit distance ACE_player > 2000) exitWith {false};
|
2015-01-13 17:05:05 +00:00
|
|
|
|
2017-12-02 13:18:35 +00:00
|
|
|
private _abort = false;
|
|
|
|
if (!local _unit && {_projectile isKindOf "BulletBase"}) then {
|
|
|
|
private _ammoCount = (_unit ammo _muzzle) + 1;
|
|
|
|
private _tracersEvery = getNumber(configFile >> "CfgMagazines" >> _magazine >> "tracersEvery");
|
|
|
|
private _lastRoundsTracer = getNumber(configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer");
|
|
|
|
_abort = _ammoCount > _lastRoundsTracer && {_tracersEvery == 0 || {(_ammoCount - _lastRoundsTracer) % _tracersEvery != 0}};
|
|
|
|
};
|
|
|
|
if (_abort) exitWith {false};
|
|
|
|
|
2016-02-07 00:00:42 +00:00
|
|
|
GVAR(trackedBullets) pushBack [_projectile, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")];
|