mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Pass the turret path too
This commit is contained in:
@ -36,7 +36,23 @@ if (_unit isKindOf "CAManBase") then {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// The unit is a vehicle
|
// The unit is a vehicle
|
||||||
private _gunner = [_unit, _weapon] call EFUNC(common,getGunner);
|
|
||||||
|
// Get the gunner and turret path.
|
||||||
|
// Code based on FUNC(getGunner), extracted for efficency.
|
||||||
|
private _gunner = objNull;
|
||||||
|
private _turret = [];
|
||||||
|
{
|
||||||
|
if (_weapon in (_unit weaponsTurret _x)) exitWith {
|
||||||
|
_gunner = _unit turretUnit _x;
|
||||||
|
_turret = _x;
|
||||||
|
};
|
||||||
|
false
|
||||||
|
} count allTurrets [_unit, true];
|
||||||
|
// Ensure that at least the pilot is returned if there is no gunner
|
||||||
|
if (isManualFire _unit && {isNull _gunner}) then {
|
||||||
|
_gunner = driver _unit;
|
||||||
|
};
|
||||||
|
|
||||||
if (_gunner == ACE_player) then {
|
if (_gunner == ACE_player) then {
|
||||||
["firedPlayerVehicle", this] call FUNC(localEvent);
|
["firedPlayerVehicle", this] call FUNC(localEvent);
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private _turret = _gunner call EFUNC(common,getTurretIndex);
|
|
||||||
|
|
||||||
private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []];
|
private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []];
|
||||||
private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
|
private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user