2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-08-07 14:43:06 +00:00
|
|
|
* Author: KoffeinFlummi, esteldunedain
|
2016-02-06 21:24:48 +00:00
|
|
|
* Adjusts the flight path of the bullet according to the zeroing. Called from the unified fired EH only for local and non-local players on foot.
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-02-10 04:22:10 +00:00
|
|
|
* Argument:
|
2016-02-06 21:24:48 +00:00
|
|
|
* None. Parameters inherited from EFUNC(common,firedEH)
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-02-10 04:22:10 +00:00
|
|
|
* Return value:
|
2015-01-11 16:42:31 +00:00
|
|
|
* None
|
2015-02-10 04:22:10 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-16 12:15:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-06 21:24:48 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
|
|
|
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
2015-08-07 14:43:06 +00:00
|
|
|
|
2016-02-06 21:24:48 +00:00
|
|
|
private ["_adjustment", "_weaponIndex", "_zeroing", "_adjustment"];
|
2015-05-09 18:02:22 +00:00
|
|
|
|
2015-05-08 18:36:24 +00:00
|
|
|
_adjustment = _unit getVariable [QGVAR(Adjustment), []];
|
|
|
|
if (_adjustment isEqualTo []) exitWith {};
|
2015-02-10 02:00:40 +00:00
|
|
|
|
2015-02-12 14:57:55 +00:00
|
|
|
_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
2015-02-10 04:22:10 +00:00
|
|
|
if (_weaponIndex < 0) exitWith {};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-02-10 04:22:10 +00:00
|
|
|
_zeroing = _adjustment select _weaponIndex;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-07 14:43:06 +00:00
|
|
|
if (_zeroing isEqualTo [0, 0, 0]) exitWith {};
|
2015-05-08 18:36:24 +00:00
|
|
|
|
2015-02-10 04:22:10 +00:00
|
|
|
// Convert zeroing from mils to degrees
|
2015-05-08 18:36:24 +00:00
|
|
|
_zeroing = _zeroing vectorMultiply 0.05625;
|
2015-08-08 19:17:03 +00:00
|
|
|
_zeroing params ["_elevation", "_windage", "_zero"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-23 16:38:19 +00:00
|
|
|
[_projectile, _windage, _elevation + _zero, 0] call EFUNC(common,changeProjectileDirection);
|