mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fcs work around for weaponDirection with commander turrets
This commit is contained in:
parent
4695376f55
commit
0d3e103de1
@ -28,7 +28,15 @@ if (_distance == 0) then {
|
||||
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
|
||||
};
|
||||
|
||||
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret);
|
||||
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
|
||||
|
||||
if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
_weaponDirection = eyeDirection _vehicle;
|
||||
};
|
||||
|
||||
if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turrets
|
||||
_weaponDirection = [1,0,0];
|
||||
};
|
||||
|
||||
GVAR(Position) = [
|
||||
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
|
||||
|
@ -21,7 +21,7 @@ _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call E
|
||||
|
||||
_distance = call FUNC(getRange);
|
||||
|
||||
_magazines = magazines _vehicle;
|
||||
_magazines = _vehicle magazinesTurret _turret;
|
||||
|
||||
if (_distance == 0) then {
|
||||
_distance = [
|
||||
@ -33,7 +33,16 @@ if (_distance == 0) then {
|
||||
|
||||
private ["_weaponDirection", "_angleTarget"];
|
||||
|
||||
_weaponDirection = _vehicle weaponDirection currentWeapon _vehicle;
|
||||
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
|
||||
|
||||
if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
_weaponDirection = eyeDirection _vehicle;
|
||||
};
|
||||
|
||||
if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turrets
|
||||
_weaponDirection = [1,0,0];
|
||||
};
|
||||
|
||||
_angleTarget = asin (_weaponDirection select 2);
|
||||
|
||||
if (count _this > 2) then {
|
||||
|
Loading…
Reference in New Issue
Block a user