mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
parent
1756ca2eeb
commit
ef9fd92898
@ -46,8 +46,8 @@ if (_lastFireMode != -1) then {
|
|||||||
|
|
||||||
[{
|
[{
|
||||||
private ["_chargeText", "_currentChargeMode", "_currentFireMode", "_display", "_elevDeg", "_elevationDiff", "_lookVector", "_notGunnerView", "_realAzimuth", "_realElevation", "_upVectorDir", "_useMils", "_weaponDir"];
|
private ["_chargeText", "_currentChargeMode", "_currentFireMode", "_display", "_elevDeg", "_elevationDiff", "_lookVector", "_notGunnerView", "_realAzimuth", "_realElevation", "_upVectorDir", "_useMils", "_weaponDir"];
|
||||||
PARAMS_2(_args,_pfID);
|
params ["_args", "_pfID"];
|
||||||
EXPLODE_2_PVT(_args,_mortarVeh,_fireModes);
|
_args params ["_mortarVeh", "_fireModes"];
|
||||||
|
|
||||||
if ((vehicle ACE_player) != _mortarVeh) then {
|
if ((vehicle ACE_player) != _mortarVeh) then {
|
||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
@ -80,7 +80,19 @@ if (_lastFireMode != -1) then {
|
|||||||
//(looking at the sky VS looking at ground will radicaly change fire direction because BIS)
|
//(looking at the sky VS looking at ground will radicaly change fire direction because BIS)
|
||||||
_realAzimuth = -1;
|
_realAzimuth = -1;
|
||||||
_realElevation = -1;
|
_realElevation = -1;
|
||||||
if ((ctrlText (_display displayCtrl 173)) == "--") then {
|
|
||||||
|
private _useRealWeaponDir = (ctrlText (_display displayCtrl 173)) == "--";
|
||||||
|
if (_useRealWeaponDir && {(_mortarVeh ammo (currentWeapon _mortarVeh)) == 0}) then {
|
||||||
|
// With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground
|
||||||
|
private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]);
|
||||||
|
private _testSeekerDir = _testSeekerPosASL vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1]));
|
||||||
|
private _laserRange = [_testSeekerPosASL, _testSeekerDir, _mortarVeh] call EFUNC(laser,shootRay);
|
||||||
|
_laserRange params ["", ["_rayDistance", -5]]; // ToDo: move shootRay to common
|
||||||
|
TRACE_2("",_rayDistance,viewDistance);
|
||||||
|
_useRealWeaponDir = _rayDistance > viewDistance; // If we are looking at infinity (based on viewDistance)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_useRealWeaponDir) then {
|
||||||
//No range (looking at sky), it will follow weaponDir:
|
//No range (looking at sky), it will follow weaponDir:
|
||||||
_weaponDir = _mortarVeh weaponDirection (currentWeapon _mortarVeh);
|
_weaponDir = _mortarVeh weaponDirection (currentWeapon _mortarVeh);
|
||||||
_realAzimuth = (_weaponDir select 0) atan2 (_weaponDir select 1);
|
_realAzimuth = (_weaponDir select 0) atan2 (_weaponDir select 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user