2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi
|
|
|
|
*
|
|
|
|
* Adjusts the flight path of the bullet according to the zeroing
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* Fired EH
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*/
|
|
|
|
|
2015-01-16 12:15:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_weapons", "_zeroing", "_direction", "_azimuth", "_altitude", "_velocity"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
_weaponType = _this select 1;
|
|
|
|
_ammoType = _this select 4;
|
|
|
|
_round = _this select 5;
|
|
|
|
_magazineType = _this select 6;
|
|
|
|
|
|
|
|
_weapons = [
|
2015-01-16 12:15:14 +00:00
|
|
|
primaryWeapon _unit,
|
|
|
|
secondaryWeapon _unit,
|
|
|
|
handgunWeapon _unit
|
2015-01-11 16:42:31 +00:00
|
|
|
];
|
|
|
|
if !(_weaponType in _weapons) exitWith {};
|
|
|
|
|
2015-01-18 07:13:37 +00:00
|
|
|
_zeroing = GVAR(Adjustment) select (_weapons find _weaponType);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
// convert zeroing from mils to degrees
|
2015-01-16 12:15:14 +00:00
|
|
|
_zeroing = [_zeroing, {_this * 0.05625}] call EFUNC(common,map);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-16 12:15:14 +00:00
|
|
|
[_round, _zeroing select 0, _zeroing select 1, 0] call EFUNC(common,changeProjectileDirection);
|