2015-03-12 05:28:33 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal, Ruthberg
|
2015-01-13 17:05:05 +00:00
|
|
|
* Handles wind deflection for projectiles.
|
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
|
|
|
* 1: weapon - Fired weapon <STRING>
|
|
|
|
* 2: muzzle - Muzzle that was used <STRING>
|
|
|
|
* 3: mode - Current mode of the fired weapon <STRING>
|
|
|
|
* 4: ammo - Ammo used <STRING>
|
|
|
|
* 5: magazine - magazine name which was used <STRING>
|
|
|
|
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
2015-01-13 17:05:05 +00:00
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
2015-01-13 17:05:05 +00:00
|
|
|
*
|
2015-03-12 05:28:33 +00:00
|
|
|
* Example:
|
2015-04-05 19:08:55 +00:00
|
|
|
* [clientFiredBIS-XEH] call ace_advanced_ballistics_fnc_handleFired
|
2015-03-12 05:28:33 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-13 17:05:05 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-09 18:27:10 +00:00
|
|
|
private ["_unit", "_bullet"];
|
|
|
|
_unit = _this select 0;
|
2015-01-13 17:05:05 +00:00
|
|
|
_bullet = _this select 6;
|
|
|
|
|
2015-04-18 19:17:37 +00:00
|
|
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false};
|
|
|
|
|
2015-04-09 18:27:10 +00:00
|
|
|
if (!hasInterface) exitWith {false};
|
2015-04-18 09:10:05 +00:00
|
|
|
if (!(GVAR(enabled))) exitWith {false};
|
2015-04-18 19:17:37 +00:00
|
|
|
if (!(GVAR(vehicleEnabled)) && !(_unit isKindOf "Man")) exitWith {false};
|
|
|
|
if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exitWith {false};
|
2015-04-12 10:33:09 +00:00
|
|
|
if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false};
|
2015-04-10 17:02:32 +00:00
|
|
|
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false};
|
2015-01-13 17:05:05 +00:00
|
|
|
|
2015-07-22 08:04:54 +00:00
|
|
|
GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> (_this select 4) >> "airFriction")];
|
2015-01-13 17:05:05 +00:00
|
|
|
|
|
|
|
true;
|